-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·42 lines (32 loc) · 1.33 KB
/
deploy.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
#!/bin/bash
#echo '[INFO] try to identify eclipse smarthome homefolder location...'
# Load openhab directory paths if available and use those for
if [ -r /etc/profile.d/openhab2.sh ]; then
. /etc/profile.d/openhab2.sh
elif [ -r /etc/default/openhab2 ]; then
. /etc/default/openhab2
fi
if [ ! -d "$ECLIPSE_SMARTHOME_HOME" ] && [ -d "$OPENHAB_HOME" ]; then
ECLIPSE_SMARTHOME_HOME=$OPENHAB_HOME
fi
if [ ! -d "$ECLIPSE_SMARTHOME_HOME" ]; then
echo "[ERROR] eclipse smarthome homefolder [$ECLIPSE_SMARTHOME_HOME] not found!"
echo '[INFO] please refer the home folder by calling "mvn install -Dorg.eclipse.smarthome.home=PATH"'
echo '[INFO] or globally define the home folder via the system variables: $ECLIPSE_SMARTHOME_HOME or $OPENHAB_HOME'
echo [WARN] skip binding deploy process...
exit ;
fi
ADDONS_HOME=$ECLIPSE_SMARTHOME_HOME/addons
if [ ! -d "$ADDONS_HOME" ]; then
# echo create missing addons folder...
mkdir -p $ADDONS_HOME
fi
# echo [INFO] deploy binding into $ECLIPSE_SMARTHOME_HOME ...
if [ ! -w $ADDONS_HOME ] ; then
echo "No permissions to deploy binding into $ADDONS_HOME"
echo "Sudo password needed to adjust permissions for user $USER"
sudo chgrp $USER $ADDONS_HOME
sudo chmod g+rwx $ADDONS_HOME
fi
rm -f $ADDONS_HOME/org.eclipse.smarthome.binding.bco-*.jar
scp -r target/*jar $ADDONS_HOME