forked from domoticz/domoticz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updaterelease
executable file
·29 lines (25 loc) · 799 Bytes
/
updaterelease
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
#!/bin/sh
# This script can be used to upgrade to the latest release version
lowercase(){
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}
OS=`lowercase \`uname -s\``
MACH=`uname -m`
if [ ${MACH} = "armv6l" ]
then
MACH="armv7l"
fi
echo "Updating to latest release version..."
echo "Please Standby..."
wget -4 -O domoticz_release.tgz --no-check-certificate "https://www.domoticz.com/download.php?channel=stable&type=release&system=${OS}&machine=${MACH}"
echo "Checking file Integrity..."
tar -tzf domoticz_release.tgz >/dev/null
if [ $? -ne 0 ]
then
echo "Problem in downloaded Domoticz archive. Stopping update!"
exit 1
fi
tar xvfz domoticz_release.tgz
rm domoticz_release.tgz
echo "Restarting Domoticz... (please standby...)"
sudo service domoticz.sh restart