From 4a69af0dd201cb87dff77c23cde38e6c6eebce00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 2 Aug 2023 21:31:02 +0200 Subject: [PATCH 1/2] When running locally derive port from FTL itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- padd.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/padd.sh b/padd.sh index 78e81fbf..58a2d4eb 100755 --- a/padd.sh +++ b/padd.sh @@ -104,6 +104,9 @@ ConstructAPI() { # If no arguments were supplied set them to default if [ -z "${URL}" ]; then URL=127.0.0.1 + # when no $URL is set we assume PADD is running locally and we can get the port value from FTL directly + PORT="$(pihole-FTL --config webserver.port)" + PORT="${PORT%%,*}" fi if [ -z "${PORT}" ]; then PORT=80 @@ -1231,7 +1234,7 @@ secretRead() { # `-n` option (reading n chars) - # This workaround changes the terminal characteristics to not echo input and later rests this option + # This workaround changes the terminal characteristics to not echo input and later resets this option # credits https://stackoverflow.com/a/4316765 # showing astrix instead of password # https://stackoverflow.com/a/24600839 From b67b0fb2e0db69e53db1773b8b2115baa9d4e0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 2 Aug 2023 21:44:01 +0200 Subject: [PATCH 2/2] Remove space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- padd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/padd.sh b/padd.sh index 58a2d4eb..fcdecc9c 100755 --- a/padd.sh +++ b/padd.sh @@ -105,7 +105,7 @@ ConstructAPI() { if [ -z "${URL}" ]; then URL=127.0.0.1 # when no $URL is set we assume PADD is running locally and we can get the port value from FTL directly - PORT="$(pihole-FTL --config webserver.port)" + PORT="$(pihole-FTL --config webserver.port)" PORT="${PORT%%,*}" fi if [ -z "${PORT}" ]; then