rc.inet1: remove leading zeros in IPv4 address

This commit is contained in:
bergware
2023-12-09 16:45:23 +01:00
parent f4ec4db8e5
commit 95e8b53cab

View File

@@ -381,7 +381,7 @@ ipaddr_up(){
if [[ -n $ADDR ]]; then
A=(${ADDR//./ })
# remove leading zeros
for x in {0..3}; do A[$x]=$((10#${A[$x]})); done
for x in ${!A[@]}; do A[$x]=$((10#${A[$x]})); done
A=${A[@]}
ADDR=${A// /.}
[[ $j -eq 0 ]] && MASK=${NETMASK[$i]} || MASK=${NETMASK[$i,$j]}