From c46a18f89f0b9af03b285b4ce39bb50bd199e42c Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Sat, 23 Feb 2019 23:50:27 +0100 Subject: [PATCH] add integer check --- home.admin/config.scripts/lnd.setport.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home.admin/config.scripts/lnd.setport.sh b/home.admin/config.scripts/lnd.setport.sh index bb2891e..b7fb246 100644 --- a/home.admin/config.scripts/lnd.setport.sh +++ b/home.admin/config.scripts/lnd.setport.sh @@ -10,6 +10,13 @@ fi portnumber=$1 +# check port numer is a integer +if ! [ "$portnumber" -eq "$portnumber" ] 2> /dev/null +then + echo "FAIL - portnumber(${portnumber}) not a number" + exit 1 +fi + # check port number is bigger then zero if [ ${portnumber} -lt 1 ]; then echo "FAIL - portnumber(${portnumber}) not above 0"