-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathonlineupdate.sh
44 lines (39 loc) · 980 Bytes
/
onlineupdate.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
#!/bin/bash
THISUSER=$(whoami)
if [ $THISUSER != 'root' ]
then
echo 'You must use sudo to run this script, sorry!'
exit 1
fi
mkdir /var/log/openflixrupdate
exec 1> >(tee -a /var/log/openflixrupdate/onlineupdate.log) 2>&1
TODAY=$(date)
echo "-----------------------------------------------------"
echo "Date: $TODAY"
echo "-----------------------------------------------------"
## OpenFLIXR Online Update version 1.0.5
echo ""
echo "OpenFLIXR Wizard Update:"
cd /usr/share/nginx/html/setup
git reset --hard
git pull
echo ""
echo "OpenFLIXR Online Update:"
cd /opt/update
chmod -x /opt/update/scripts/*
git pull
echo ""
echo "OpenFLIXR installing updates:"
chmod +x /opt/update/scripts/*
cd /opt/update/doneupdate/
FILES=*
for f in $FILES
do
if [ "$f" != '*' ]
then
rm /opt/update/scripts/$f
fi
done
run-parts /opt/update/scripts
## let setup know onlineupdate finished
echo "onlineupdate finished"