From b16440963d84881b25db956a816baceb525159f8 Mon Sep 17 00:00:00 2001 From: andre <> Date: Thu, 21 May 2020 00:22:29 +0200 Subject: [PATCH 1/4] fix download of iobroker install.sh --- aarch64/Dockerfile | 2 +- amd64/Dockerfile | 2 +- armv7hf/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aarch64/Dockerfile b/aarch64/Dockerfile index e11bd09..3a22f81 100644 --- a/aarch64/Dockerfile +++ b/aarch64/Dockerfile @@ -61,7 +61,7 @@ COPY scripts/userscript_everystart_example.sh userscript_everystart_example.sh # Install ioBroker WORKDIR / RUN apt-get update \ - && curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \ + && curl -sL https://iobroker.net/install.sh | bash - \ && echo $(hostname) > /opt/iobroker/.install_host \ && echo $(hostname) > /opt/.firstrun \ && rm -rf /var/lib/apt/lists/* diff --git a/amd64/Dockerfile b/amd64/Dockerfile index f0a3d33..fc300d5 100644 --- a/amd64/Dockerfile +++ b/amd64/Dockerfile @@ -61,7 +61,7 @@ COPY scripts/userscript_everystart_example.sh userscript_everystart_example.sh # Install ioBroker WORKDIR / RUN apt-get update \ - && curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \ + && curl -sL https://iobroker.net/install.sh | bash - \ && echo $(hostname) > /opt/iobroker/.install_host \ && echo $(hostname) > /opt/.firstrun \ && rm -rf /var/lib/apt/lists/* diff --git a/armv7hf/Dockerfile b/armv7hf/Dockerfile index a550df3..73f0434 100644 --- a/armv7hf/Dockerfile +++ b/armv7hf/Dockerfile @@ -61,7 +61,7 @@ COPY scripts/userscript_everystart_example.sh userscript_everystart_example.sh # Install ioBroker WORKDIR / RUN apt-get update \ - && curl -sL https://raw.githubusercontent.com/ioBroker/ioBroker/stable-installer/installer.sh | bash - \ + && curl -sL https://iobroker.net/install.sh | bash - \ && echo $(hostname) > /opt/iobroker/.install_host \ && echo $(hostname) > /opt/.firstrun \ && rm -rf /var/lib/apt/lists/* From 3a4ae3ec5574c2daf187052dbcd6fdf4e1de960e Mon Sep 17 00:00:00 2001 From: buanet Date: Wed, 3 Jun 2020 21:52:28 +0200 Subject: [PATCH 2/4] testing to fix "iobroker host" issue --- amd64/scripts/iobroker_startup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/amd64/scripts/iobroker_startup.sh b/amd64/scripts/iobroker_startup.sh index 1e9b430..f8626bc 100644 --- a/amd64/scripts/iobroker_startup.sh +++ b/amd64/scripts/iobroker_startup.sh @@ -166,16 +166,20 @@ if [ -f /opt/iobroker/.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/iobroker/.install_host) + oldhostname=$(cat /opt/iobroker/.install_host) + newhostname=$(hostname) + sed -i 's/$oldhostname/$newhostname/g' /opt/iobroker/iobroker-data/states.json + sed -i 's/$oldhostname/$newhostname/g' /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(cat /opt/iobroker/.install_host) rm -f /opt/iobroker/.install_host - echo 'Done.' + 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 "Done." echo ' ' fi @@ -201,7 +205,7 @@ then echo "Adminport set by ENV does not match port configured in ioBroker installation." echo "Setting Adminport to \""$adminport"\"..." bash iobroker set admin.0 --port $adminport - echo 'Done.' + echo "Done." echo ' ' fi fi From a86082e09748db9cd8b1953cbc2894eaa12ca73b Mon Sep 17 00:00:00 2001 From: buanet Date: Wed, 3 Jun 2020 22:34:09 +0200 Subject: [PATCH 3/4] testing --- amd64/scripts/iobroker_startup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/scripts/iobroker_startup.sh b/amd64/scripts/iobroker_startup.sh index f8626bc..1022561 100644 --- a/amd64/scripts/iobroker_startup.sh +++ b/amd64/scripts/iobroker_startup.sh @@ -168,8 +168,8 @@ then echo "Hostname needs to be updated to " $(hostname)"..." oldhostname=$(cat /opt/iobroker/.install_host) newhostname=$(hostname) - sed -i 's/$oldhostname/$newhostname/g' /opt/iobroker/iobroker-data/states.json - sed -i 's/$oldhostname/$newhostname/g' /opt/iobroker/iobroker-data/objects.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json # bash iobroker host $(cat /opt/iobroker/.install_host) rm -f /opt/iobroker/.install_host echo "Done." From 0b143cca5a663855b68726976feeb360d63b5e86 Mon Sep 17 00:00:00 2001 From: buanet Date: Wed, 3 Jun 2020 23:52:57 +0200 Subject: [PATCH 4/4] workaround for renaming issues, preparing beta status --- .VERSION | 2 +- README.md | 10 ++++++---- aarch64/scripts/iobroker_startup.sh | 18 +++++++++++++----- amd64/scripts/iobroker_startup.sh | 6 +++++- armv7hf/scripts/iobroker_startup.sh | 18 +++++++++++++----- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/.VERSION b/.VERSION index 819609f..2551808 100644 --- a/.VERSION +++ b/.VERSION @@ -1 +1 @@ -v4.2.1beta +v4.2.2beta diff --git a/README.md b/README.md index f51b81f..71363e5 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ After this the startup script inside the container will automatically detect and ### Beta testing -If you want to get the newest features and changes feel free to use/ test the beta version of the Docker image. You can find the readme.md file for beta versions [here](https://github.com/buanet/docker-iobroker/blob/beta/README.md). +If you want to get the newest features and changes feel free to use/ test the beta version of the Docker image. You can find the readme.md file for beta versions [here](https://github.com/buanet/docker-iobroker/blob/beta/README.md). Please make sure to read the changelog before testing beta versions. ### Subscribe to updates @@ -157,9 +157,11 @@ Thank you! ## Changelog -### v4.2.1beta (2020-05-10) -* using node 12 instead of 10 -* updated documentation in readme.md +### v4.2.2beta (2020-06-03) +* workaround for renaming issues on startup +* v4.2.1beta (2020-05-10) + * using node 12 instead of 10 + * updated documentation in readme.md ### v4.2.0 (2020-04-14) * v4.1.4beta (2020-04-07) diff --git a/aarch64/scripts/iobroker_startup.sh b/aarch64/scripts/iobroker_startup.sh index 1e9b430..892b84b 100644 --- a/aarch64/scripts/iobroker_startup.sh +++ b/aarch64/scripts/iobroker_startup.sh @@ -166,16 +166,24 @@ if [ -f /opt/iobroker/.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/iobroker/.install_host) + oldhostname=$(cat /opt/iobroker/.install_host) + newhostname=$(hostname) + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(cat /opt/iobroker/.install_host) rm -f /opt/iobroker/.install_host - echo 'Done.' + 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.' + oldhostname=$(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') + newhostname=$(hostname) + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') + echo "Done." echo ' ' fi @@ -201,7 +209,7 @@ then echo "Adminport set by ENV does not match port configured in ioBroker installation." echo "Setting Adminport to \""$adminport"\"..." bash iobroker set admin.0 --port $adminport - echo 'Done.' + echo "Done." echo ' ' fi fi diff --git a/amd64/scripts/iobroker_startup.sh b/amd64/scripts/iobroker_startup.sh index 1022561..892b84b 100644 --- a/amd64/scripts/iobroker_startup.sh +++ b/amd64/scripts/iobroker_startup.sh @@ -178,7 +178,11 @@ elif [ $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(? 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": ")[^"]*') + oldhostname=$(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') + newhostname=$(hostname) + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') echo "Done." echo ' ' fi diff --git a/armv7hf/scripts/iobroker_startup.sh b/armv7hf/scripts/iobroker_startup.sh index 1e9b430..892b84b 100644 --- a/armv7hf/scripts/iobroker_startup.sh +++ b/armv7hf/scripts/iobroker_startup.sh @@ -166,16 +166,24 @@ if [ -f /opt/iobroker/.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/iobroker/.install_host) + oldhostname=$(cat /opt/iobroker/.install_host) + newhostname=$(hostname) + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(cat /opt/iobroker/.install_host) rm -f /opt/iobroker/.install_host - echo 'Done.' + 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.' + oldhostname=$(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') + newhostname=$(hostname) + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/states.json + sed -i "s/$oldhostname/$newhostname/g" /opt/iobroker/iobroker-data/objects.json + # bash iobroker host $(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') + echo "Done." echo ' ' fi @@ -201,7 +209,7 @@ then echo "Adminport set by ENV does not match port configured in ioBroker installation." echo "Setting Adminport to \""$adminport"\"..." bash iobroker set admin.0 --port $adminport - echo 'Done.' + echo "Done." echo ' ' fi fi