tmpl_std: run.sh: make 'ip addr add $ip2' optional

This commit is contained in:
Neels Hofmeyr 2018-09-16 13:49:13 +02:00
parent dd37c72bca
commit ede8016f4b
1 changed files with 8 additions and 2 deletions

View File

@ -21,8 +21,14 @@ if [ -z "$(ip tuntap show | grep $apn)" ]; then
sudo ip link set $apn up
fi
if [ -z "$(ip addr show dev $dev | grep "$ip2")" ]; then
sudo ip addr add ${PUBLIC_IP2}/32 dev $dev
if [ -z "$(ip addr show | grep "$PUBLIC_IP")" ]; then
echo "No interface has IP address $PUBLIC_IP! Hit enter to continue anyway."
read enter_to_continue
fi
if [ -z "$(ip addr show | grep "$ip2")" ]; then
echo "No interface has IP address $ip2! Hit enter to 'ip addr add $ip2/32 dev $dev'"
read enter_to_continue
sudo ip addr add $ip2/32 dev $dev
fi
logdir="current_log"