mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-19 09:50:19 +01:00
remove the square brackets from IP in a oneliner (#1620)
This commit is contained in:
parent
8dc0346e62
commit
c6654235cb
@ -149,12 +149,8 @@ if [ ${runGlobal} -eq 1 ]; then
|
||||
##########################################
|
||||
# Clean IP
|
||||
# really just the IP value - without the default brackets if IPv6
|
||||
has_brackets="$(echo "${publicIP}" | grep -c '\[')"
|
||||
if [ ${has_brackets} -eq 0 ]; then
|
||||
cleanIP="${publicIP}"
|
||||
else
|
||||
cleanIP="$(echo "${publicIP}" | cut -d'[' -f2 | cut -d']' -f1)"
|
||||
fi
|
||||
# for IPV4 case the "tr" will do no harm.
|
||||
cleanIP=$(echo "${publicIP}" | tr -d '[]')
|
||||
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user