-
Notifications
You must be signed in to change notification settings - Fork 18
/
update_xeoma.sh
executable file
·41 lines (30 loc) · 1.18 KB
/
update_xeoma.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
#!/bin/bash
# These need to match 40_install_xeoma.sh
INSTALL_LOCATION=/files/xeoma
LAST_INSTALLED_BREADCRUMB=$INSTALL_LOCATION/last_installed_version.txt
#-----------------------------------------------------------------------------------------------------------------------
function ts {
echo [`date '+%b %d %X'`]
}
#-----------------------------------------------------------------------------------------------------------------------
function get_installed_version {
if [[ -e "$LAST_INSTALLED_BREADCRUMB" ]];then
cat "$LAST_INSTALLED_BREADCRUMB" | tr -d '\n'
else
echo -n ""
fi
}
#-----------------------------------------------------------------------------------------------------------------------
echo "$(ts) Attempting to auto-update Xeoma"
echo "vvvvvvvvvvvvvvvvvvv"
last_installed_version=$(get_installed_version)
/etc/my_init.d/40_install_xeoma.py
new_installed_version=$(get_installed_version)
echo "^^^^^^^^^^^^^^^^^^^"
if [[ "$last_installed_version" != "$new_installed_version" ]];then
echo "$(ts) Xeoma has been updated. Restarting the service."
pkill xeoma
# The phusion framework will restart it for us
else
echo "$(ts) Xeoma has not been updated."
fi