This commit is contained in:
buanet
2021-09-18 19:31:51 +02:00
parent 3625cbd854
commit 01175aa825
2 changed files with 5 additions and 22 deletions

View File

@@ -48,9 +48,11 @@ WORKDIR /
RUN apt-get update \ RUN apt-get update \
&& curl -sL https://iobroker.net/install.sh | bash - \ && curl -sL https://iobroker.net/install.sh | bash - \
&& mkdir -p /opt/scripts/.docker_config/ \ && mkdir -p /opt/scripts/.docker_config/ \
&& echo $(hostname) > /opt/scripts/.docker_config/.install_host \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \ && echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
&& echo $(hostname) > /opt/.firstrun \ && echo $(hostname) > /opt/.firstrun \
# Deleting UUID from build
&& iobroker unsetup -y
# Backup initial ioBroker and userscript folder # Backup initial ioBroker and userscript folder
&& tar -cf /opt/initial_iobroker.tar /opt/iobroker \ && tar -cf /opt/initial_iobroker.tar /opt/iobroker \
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts \ && tar -cf /opt/initial_userscripts.tar /opt/userscripts \

View File

@@ -75,7 +75,7 @@ echo "$(printf -- '-%.0s' {1..80})"
echo ' ' echo ' '
# Adding ckeck file for easy docker detection by ioBroker # 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 # 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 ] 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..." echo "Restoring initial ioBroker installation..."
tar -xf /opt/initial_iobroker.tar -C / tar -xf /opt/initial_iobroker.tar -C /
# Removing UUID generated on docker image build # Removing UUID generated on docker image build
bash iobroker unsetup -y #bash iobroker unsetup -y # <<< moved to dockerfile
echo "Done." echo "Done."
elif [ -f /opt/iobroker/iobroker ] elif [ -f /opt/iobroker/iobroker ]
then then
echo "Existing installation of ioBroker detected in /opt/iobroker." 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" ] 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 then
if [ "$multihost" = "slave" ] if [ "$multihost" = "slave" ]
@@ -216,24 +215,6 @@ then
echo ' ' echo ' '
fi 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 # STEP 4 - Setting up prerequisites for some ioBroker-adapters