-
Notifications
You must be signed in to change notification settings - Fork 0
/
displayNoteUpdater.sh
executable file
·67 lines (46 loc) · 1.6 KB
/
displayNoteUpdater.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
################################################
# School District of Janesville
# Technology Department
#
# Author: Brent Williams
# Date: 4/01/14
# Purpose: Automatically Downloads the newest version of DisplayNote
# and installs on the clients.
################################################
#STEP 1: DOWNLOAD DISPLAYNOTE
if [[ ! -d DisplayNote ]]; then
mkdir /tmp/DisplayNote
cd /tmp/DisplayNote
else
cd /tmp/DisplayNote
fi
site="http://displaynote.com/public/uploads/displaynote/macos/"
for file in $(curl -s $site |
grep href |
sed 's/.*href="//' |
sed 's/".*//' |
sed 's/.*json//' |
grep '^[a-zA-Z].*' |
awk END{print} ); do
echo "Downloading Newest DisplayNote Version : $file..."
curl -# -O --progress-bar $site$file
done
#STEP 2: CONVERT TO SKIP EULA AND INSTALL
echo "Copying DisplayNote to Applications..."
if [[ -d /Applications/DisplayNote.app ]]; then
rm -r /Applications/DisplayNote.app
/usr/bin/hdiutil convert -quiet $file -format UDTO -o "${file%.*}"
/usr/bin/hdiutil mount -quiet -nobrowse -noverify -noautoopen "${file%.*}".cdr
else
/usr/bin/hdiutil convert -quiet $file -format UDTO -o "${file%.*}"
/usr/bin/hdiutil mount -quiet -nobrowse -noverify -noautoopen "${file%.*}".cdr
fi
sleep 5s
mv /Volumes/"${file%.*}"/DisplayNote.app /Applications/
#STEP 3: SUBMIT INVENTORY TO JSS
echo "SUBMITTING INVENTORY TO THE JSS..."
jamf -recon verbose
echo "FINISHED INVENTORY UPDATE FOR" `hostname -s`
umount /Volumes/"${file%.*}"
rm -r /tmp/DisplayNote