-
Notifications
You must be signed in to change notification settings - Fork 0
/
updatedomo
executable file
·39 lines (36 loc) · 1.06 KB
/
updatedomo
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
#!/bin/sh
SVN_SERVER="svn://svn.code.sf.net/p/domoticz/code/trunk"
echo "Checking the server revision..."
SERVER_REVISION=`svn log -l1 $SVN_SERVER | sed -n 2p | sed 's/.\([0-9][0-9][0-9][0-9]\).*/\1/'`
echo "Server revision at $SERVER_REVISION"
echo "Checking the working copy revision..."
LOCAL_REVISION=`svn log -l1 | sed -n 2p | sed 's/.\([0-9][0-9][0-9][0-9]\).*/\1/'`
echo "Working copy revision at $LOCAL_REVISION"
if [ "$SERVER_REVISION" -eq "$LOCAL_REVISION" ]
then
echo "Domoticz is up to date. Nothing to do."
exit 1
else
svn update
if [ $? -ne 0 ]
then
echo "svnupdate failed!";
exit 1
fi
cmake -DCMAKE_BUILD_TYPE=Release .
if [ $? -ne 0 ]
then
echo "CMake failed!";
exit 1
fi
make
if [ $? -ne 0 ]
then
echo "Compile failed!";
exit 1
fi
# stop domoticz
echo "Restarting Domoticz... (please standby...)"
sudo service domoticz.sh stop
sudo service domoticz.sh start
fi