mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2026-01-27 01:21:35 +02:00
testing
This commit is contained in:
@@ -78,14 +78,19 @@ RUN chsh -s /bin/bash iobroker \
|
||||
&& usermod --home /opt/iobroker iobroker
|
||||
|
||||
# Setting up ENVs
|
||||
ENV ADMINPORT=8081 \
|
||||
AVAHI="false" \
|
||||
ENV AVAHI="false" \
|
||||
DEBIAN_FRONTEND="teletype" \
|
||||
IOB_ADMINPORT=8081 \
|
||||
IOB_OBJECTSDB_HOST="127.0.0.1" \
|
||||
IOB_OBJECTSDB_PORT="9001" \
|
||||
IOB_OBJECTSDB_TYPE="file" \
|
||||
IOB_STATESDB_HOST="127.0.0.1" \
|
||||
IOB_STATESDB_PORT="9000" \
|
||||
IOB_STATESDB_TYPE="file" \
|
||||
LANG="de_DE.UTF-8" \
|
||||
LANGUAGE="de_DE:de" \
|
||||
LC_ALL="de_DE.UTF-8" \
|
||||
PACKAGES="vi" \
|
||||
REDIS="false" \
|
||||
SETGID=1000 \
|
||||
SETUID=1000 \
|
||||
TZ="Europe/Berlin" \
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Reading ENV
|
||||
adminport=$ADMINPORT
|
||||
adminport=$IOB_ADMINPORT
|
||||
avahi=$AVAHI
|
||||
gid=$SETGID
|
||||
objectsdbhost=$IOB_OBJECTSDB_HOST
|
||||
objectsdbport=$IOB_OBJECTSDB_PORT
|
||||
objectsdbtype=$IOB_OBJECTSDB_TYPE
|
||||
packages=$PACKAGES
|
||||
redis=$REDIS
|
||||
statesdbhost=$IOB_STATESDB_HOST
|
||||
statesdbport=$IOB_STATESDB_PORT
|
||||
statesdbtype=$IOB_STATESDB_TYPE
|
||||
uid=$SETUID
|
||||
usbdevices=$USBDEVICES
|
||||
zwave=$ZWAVE
|
||||
@@ -229,7 +234,7 @@ then
|
||||
echo ' '
|
||||
fi
|
||||
|
||||
# Checking ENV for REDIS
|
||||
# Checking ENVs for custom setup of objects db
|
||||
if [ "$redis" != "false" ]
|
||||
then
|
||||
echo "Connection to Redis is configured by ENV."
|
||||
@@ -245,13 +250,18 @@ then
|
||||
echo ' '
|
||||
fi
|
||||
|
||||
# Checking ENVs for custom setup of states db#
|
||||
|
||||
|
||||
|
||||
|
||||
# Checking for Userscripts in /opt/userscripts
|
||||
if [ `find /opt/userscripts -type f | wc -l` -lt 1 ]
|
||||
then
|
||||
echo "There is no data detected in /opt/userscripts. Restoring exapmple userscripts..."
|
||||
tar -xf /opt/initial_userscripts.tar -C /
|
||||
chmod 755 userscript_firststart_example.sh
|
||||
chmod 755 userscript_everystart_example.sh
|
||||
chmod 755 /opt/userscripts/userscript_firststart_example.sh
|
||||
chmod 755 /opt/userscripts/userscript_everystart_example.sh
|
||||
echo "Done."
|
||||
echo ' '
|
||||
elif [ -f /opt/userscripts/userscript_firststart.sh ] || [ -f /opt/userscripts/userscript_everystart.sh ]
|
||||
@@ -260,7 +270,7 @@ then
|
||||
then
|
||||
echo "Userscript for first start detected and this is the first start of a new container."
|
||||
echo "Running userscript_firststart.sh..."
|
||||
chmod 755 userscript_firststart.sh
|
||||
chmod 755 /opt/userscripts/userscript_firststart.sh
|
||||
bash /opt/userscripts/userscript_firststart.sh
|
||||
rm -f /opt/.firstrun
|
||||
echo "Done."
|
||||
@@ -269,7 +279,7 @@ then
|
||||
if [ -f /opt/userscripts/userscript_everystart.sh ]
|
||||
then
|
||||
echo "Userscript for every start detected. Running userscript_everystart.sh..."
|
||||
chmod 755 userscript_everystart.sh
|
||||
chmod 755 /opt/userscripts/userscript_everystart.sh
|
||||
bash /opt/userscripts/userscript_everystart.sh
|
||||
echo "Done."
|
||||
echo ' '
|
||||
|
||||
@@ -5,4 +5,9 @@
|
||||
|
||||
# You can add your advanced script code here!
|
||||
|
||||
echo ' '
|
||||
echo "I'm your startscript userscript_everystart.sh. I will run on EVERY container startup."
|
||||
echo ' '
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -5,4 +5,8 @@
|
||||
|
||||
# You can add your advanced script code here!
|
||||
|
||||
echo ' '
|
||||
echo "I'm your startscript userscript_firststart.sh. I will run only on the FIRST startup of the container."
|
||||
echo ' '
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user