changes for first run

This commit is contained in:
Andre
2019-01-24 18:11:30 +01:00
parent 8e79ccfc2c
commit f75043438c
3 changed files with 18 additions and 14 deletions

View File

@@ -57,9 +57,9 @@ RUN chmod +x avahi_startup.sh \
# Install ioBroker
WORKDIR /
RUN echo $(hostname) > /opt/scripts/.install_host \
&& apt-get update \
RUN apt-get update \
&& curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \
&& echo $(hostname) > /opt/iobroker/.install_host \
&& rm -rf /var/lib/apt/lists/*
# Install node-gyp

View File

@@ -1,7 +1,7 @@
#!/bin/sh
echo 'Preparing...'
rm /var/run/dbus/pid >/dev/null 2>&1
rm /var/run/dbus/pid
dbus-daemon --system
echo 'Restarting...'

View File

@@ -2,18 +2,22 @@
cd /opt/iobroker
if [ -f /opt/scripts/.install_host ];
echo 'Startupscript running...'
if [ `ls -1a|wc -l` -lt 3 ];
then
echo 'First run preparation! Used Hostname:' $(hostname)
echo 'STEP 1 of 2: Restoring if ioBroker-folder empty...'
if [ `ls -1a|wc -l` -lt 3 ];
then
tar -xf /opt/initial_iobroker.tar -C /
echo 'Restoring done...'
fi
echo 'STEP 2 of 2: Renaming ioBroker...'
iobroker host $(cat /opt/scripts/.install_host)
rm /opt/scripts/.install_host
echo 'Directory /opt/iobroker is empty!'
echo 'Restoring...'
tar -xf /opt/initial_iobroker.tar -C /
echo 'Restoring done...'
fi
if [ -f /opt/iobroker/.install_host ];
then
echo 'First run preparation! Used Hostname:' $(hostname)
echo 'Renaming ioBroker...'
iobroker host $(cat /opt/iobroker/.install_host)
rm /opt/iobroker/.install_host
echo 'First run preparation done...'
fi