mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 22:58:43 +01:00
prevent double adding
This commit is contained in:
parent
2d72f91ec0
commit
54c1557e9a
1 changed files with 9 additions and 1 deletions
|
@ -22,8 +22,16 @@ if [ "$1" = "ip-add" ]; then
|
|||
# 2. parameter: ip
|
||||
ip=$2
|
||||
countDots=$(echo "$ip" | grep -c '.')
|
||||
if [ "${countDots}" != "4" ]; then
|
||||
if [ ${countDots} -eq 0 ]; then
|
||||
echo "error='missing or invalid ip'"
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if IP is already added
|
||||
found=$(sudo cat ${LNDCONF} | grep -c "tlsextraip=${ip}")
|
||||
if [ ${found} -gt 0 ]; then
|
||||
echo "# OK the IP was already added lnd.conf"
|
||||
exit
|
||||
fi
|
||||
|
||||
# simply add the line to the LND conf
|
||||
|
|
Loading…
Add table
Reference in a new issue