Correction of increment

This commit is contained in:
Tristan Le Chanony 2019-11-08 08:19:57 +01:00
parent 348c4b1151
commit 0745ab92b5

View file

@ -45,13 +45,17 @@ RANGE="2a01:4f8:161:2269:8000:c01d:c01a:"
## Starting script #####################################
info "generating new IP"
num_loop=0
for i in $(seq ${LAST_DIGIT_HEXA} $((16#ffff)));
do
NEW_IP=$(printf "${RANGE}%.4x\n" $i)
LAST_DIGIT_NEW_IP=$(printf '%x\n' $i)
break;
num_loop=$((num_loop+1))
if [ ${num_loop} -eq "2" ]; then
break;
fi
done
echo ${LAST_DIGIT_NEW_IP}
info "Setting new IP"
ip -6 addr add ${NEW_IP}/65 dev eth0