-
Notifications
You must be signed in to change notification settings - Fork 5
/
Adobe_RUM_Update_ALL_wSUS.sh
executable file
·97 lines (67 loc) · 2.64 KB
/
Adobe_RUM_Update_ALL_wSUS.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
#Script Version: 2.0
#Script Author: Aaron Polley, CompNow, 2019-11-04
#IP Address of the Caching Server
ServerADD="sus.domain.com"
#Log file for RUM run that will be displayed at the end
log_file="/var/log/AdobeRUM.log"
touch "$log_file"
chmod 755 $log_file
FINDER_PROCESS=$(pgrep -l "Finder")
if [ "$FINDER_PROCESS" != "" ]
then
# Open the log file for all logged in users
for pid_uid in $(ps -axo pid,uid,args | grep -i "[l]oginwindow.app" | awk '{print $1 "," $2}'); do
pid=$(echo $pid_uid | cut -d, -f1)
uid=$(echo $pid_uid | cut -d, -f2)
# Replace echo with e.g. launchctl load.
launchctl asuser "$uid" chroot -u "$uid" / open "$log_file"
done
fi
#---Redirect output to log and shell---#
{
echo "***************************************************************************************"
echo "***Run Start***"
date
echo "***************************************************************************************"
if [ ! -e /usr/local/bin/RemoteUpdateManager ]
then
echo "ERROR: RUM binary is missing, not proceeding with updates"
exit 1
fi
if [ -e /Library/Application\ Support/Adobe/AAMUpdater/1.0/AdobeUpdater.Overrides ]
then
if ping -q -c 1 -W 1 "$ServerADD" >/dev/null
then
#Temp fix fo broken cache#
mv /Library/Application\ Support/Adobe/AAMUpdater/1.0/AdobeUpdater.Overrides /Library/Application\ Support/Adobe/AAMUpdater/1.0/AdobeUpdater.Overrides.temp
#Temp fix fo broken cache END#
echo "Running Adobe Remote Update Manager from local cache"
/usr/local/bin/RemoteUpdateManager --action=list
sleep 1
/usr/local/bin/RemoteUpdateManager --action=install
#Temp fix fo broken cache#
mv /Library/Application\ Support/Adobe/AAMUpdater/1.0/AdobeUpdater.Overrides.temp /Library/Application\ Support/Adobe/AAMUpdater/1.0/AdobeUpdater.Overrides
#Temp fix fo broken cache END#
else
echo "ERROR: Caching server is offline, please contact HelpDesk for assistance."
fi
else
echo "ERROR: Overrides file is missing, not proceeding with updates"
exit 1
fi
echo "***************************************************************************************"
echo "***Run End***"
date
echo "***************************************************************************************"
} 2>&1 | tee -a $log_file
if [ "$FINDER_PROCESS" != "" ]
then
# Open the log file for all logged in users
for pid_uid in $(ps -axo pid,uid,args | grep -i "[l]oginwindow.app" | awk '{print $1 "," $2}'); do
pid=$(echo $pid_uid | cut -d, -f1)
uid=$(echo $pid_uid | cut -d, -f2)
# Replace echo with e.g. launchctl load.
launchctl asuser "$uid" chroot -u "$uid" / open "$log_file"
done
fi