From 01175aa825732ff6fab294cdd9552c78873d81a7 Mon Sep 17 00:00:00 2001 From: buanet Date: Sat, 18 Sep 2021 19:31:51 +0200 Subject: [PATCH] testing --- debian/node12/Dockerfile | 4 +++- debian/scripts/iobroker_startup.sh | 23 ++--------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/debian/node12/Dockerfile b/debian/node12/Dockerfile index d594501..720a8c4 100644 --- a/debian/node12/Dockerfile +++ b/debian/node12/Dockerfile @@ -48,9 +48,11 @@ WORKDIR / RUN apt-get update \ && curl -sL https://iobroker.net/install.sh | bash - \ && mkdir -p /opt/scripts/.docker_config/ \ - && echo $(hostname) > /opt/scripts/.docker_config/.install_host \ && echo "starting" > /opt/scripts/.docker_config/.healthcheck \ + && echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \ && echo $(hostname) > /opt/.firstrun \ + # Deleting UUID from build + && iobroker unsetup -y # Backup initial ioBroker and userscript folder && tar -cf /opt/initial_iobroker.tar /opt/iobroker \ && tar -cf /opt/initial_userscripts.tar /opt/userscripts \ diff --git a/debian/scripts/iobroker_startup.sh b/debian/scripts/iobroker_startup.sh index 84e2964..ef5e6b8 100644 --- a/debian/scripts/iobroker_startup.sh +++ b/debian/scripts/iobroker_startup.sh @@ -75,7 +75,7 @@ echo "$(printf -- '-%.0s' {1..80})" echo ' ' # Adding ckeck file for easy docker detection by ioBroker -echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker +# echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker # <<< moved to dockerfile # Installing/updating additional packages, registering maintenance script and setting uid/gid if [ "$packages" != "" ] || [ $(cat /etc/group | grep 'iobroker:' | cut -d':' -f3) != $setgid ] || [ $(cat /etc/passwd | grep 'iobroker:' | cut -d':' -f3) != $setuid ] || [ -f /opt/.firstrun ] @@ -133,12 +133,11 @@ then echo "Restoring initial ioBroker installation..." tar -xf /opt/initial_iobroker.tar -C / # Removing UUID generated on docker image build - bash iobroker unsetup -y + #bash iobroker unsetup -y # <<< moved to dockerfile echo "Done." elif [ -f /opt/iobroker/iobroker ] then echo "Existing installation of ioBroker detected in /opt/iobroker." - rm -f /opt/scripts/.docker_config/.install_host elif [ $(ls *_backupiobroker.tar.gz 2> /dev/null | wc -l) != "0" ] && [ $(tar -ztvf /opt/iobroker/*_backupiobroker.tar.gz "backup/backup.json" 2> /dev/null | wc -l) != "0" ] then if [ "$multihost" = "slave" ] @@ -216,24 +215,6 @@ then echo ' ' fi -# Checking for first run of a new installation and renaming ioBroker -#if [ -f /opt/scripts/.docker_config/.install_host ] -#then -# echo "Looks like this is a new and empty installation of ioBroker." -# echo "Hostname needs to be updated to " $(hostname)"..." -# bash iobroker host $(cat /opt/scripts/.docker_config/.install_host) -# rm -f /opt/scripts/.docker_config/.install_host -# echo "Done." -# echo ' ' -#elif [ $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') != $(hostname) ] -#then -# echo "Hostname in ioBroker does not match the hostname of this container." -# echo "Updating hostname to " $(hostname)"..." -# bash iobroker host $(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') -# echo "Done." -# echo ' ' -#fi - ##### # STEP 4 - Setting up prerequisites for some ioBroker-adapters