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 # Install ioBroker
WORKDIR / WORKDIR /
RUN echo $(hostname) > /opt/scripts/.install_host \ RUN apt-get update \
&& apt-get update \
&& curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \ && 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/* && rm -rf /var/lib/apt/lists/*
# Install node-gyp # Install node-gyp

View File

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

View File

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