From 2c6f3f3279791d107fae92ce056f0e3b15433b09 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 14 Jan 2019 20:22:32 +0100 Subject: [PATCH] #273 prevent double publicIP entry --- home.admin/_bootstrap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 08aad07..092c27b 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -257,7 +257,8 @@ if [ ${configExists} -eq 1 ]; then # update public IP on boot freshPublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) - if [ ${#publicIP} -eq 0 ]; then + publicIPValueExists=$( sudo cat ${configFile} | grep -c 'publicIP=' ) + if [ ${publicIPValueExists} -eq 0 ]; then echo "create value (${freshPublicIP})" >> $logFile echo "publicIP=${freshPublicIP}" >> $configFile else