Skip to content

Commit

Permalink
add integer check
Browse files Browse the repository at this point in the history
  • Loading branch information
rootzoll committed Feb 23, 2019
1 parent 3b4edf5 commit c46a18f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions home.admin/config.scripts/lnd.setport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c46a18f

Please sign in to comment.