forked from jorelwilkins/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploadPackageJCDS.sh
35 lines (32 loc) · 1.43 KB
/
uploadPackageJCDS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
####################################################################################################
#
# THIS SCRIPT IS NOT AN OFFICIAL PRODUCT OF JAMF SOFTWARE
# AS SUCH IT IS PROVIDED WITHOUT WARRANTY OR SUPPORT
#
# BY USING THIS SCRIPT, YOU AGREE THAT JAMF SOFTWARE
# IS UNDER NO OBLIGATION TO SUPPORT, DEBUG, OR OTHERWISE
# MAINTAIN THIS SCRIPT
#
####################################################################################################
#
# DESCRIPTION
# This can upload a file to the JCDS thru the API
# Credit go to Jamf Nation User: Yamashiro for inspiration
####################################################################################################
#
# DEFINE VARIABLES & READ IN PARAMETERS
#
####################################################################################################
read -p "Jamf Pro URL: " server
read -p "Jamf Pro Username: " username
read -s -p "Jamf Pro Password: " password
echo ""
read -p "Full File Name (including file type): " filename
read -p "Drag package into this window and click enter: " path
####################################################################################################
#
# MAIN PROCESS
#
####################################################################################################
curl -u "$username":"$password" -X POST "$server"/dbfileupload -H 'DESTINATION: 0' -H 'OBJECT_ID: -1' -H 'FILE_TYPE: 0' -H 'FILE_NAME: '$filename'' -T "$path"