forked from aptalca/docker-ha-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firstrun.sh
25 lines (21 loc) · 872 Bytes
/
firstrun.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
#!/bin/bash
#Get docker env timezone and set system timezone
echo "setting the correct local time"
echo $TZ > /etc/timezone
export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive
dpkg-reconfigure tzdata
cd /config
if [ ! -f /config/ha-bridge-"$VERSION".jar ]; then
echo "Installing version '$VERSION'"
wget http:https://www.bwssystems.com/files/ha-bridge-"$VERSION".jar
else
echo "Using existing version '$VERSION'"
fi
echo "Setting correct permissions"
chown -R nobody:users /config
#check to see if SERVERPORT variable is set, if not, set it to default
if [ -z "$SERVERPORT" ]; then
echo "SERVERPORT environment not passed, using default port 8080"
SERVERPORT=8080
fi
/sbin/setuser nobody java -Xmx312M -jar -Djava.net.preferIPv4Stack=true -Dupnp.config.address=$SERVERIP -Dserver.port=$SERVERPORT -Dvera.address=$VERAIP ha-bridge-"$VERSION".jar