Fix static ip route

when using a static ip should set default gateway
also noticed an echo line not going to the $LOG

Closes: #133 [via git-merge-pr]
This commit is contained in:
Dave Akers 2020-07-20 03:47:49 -05:00 committed by Michael Aldridge
parent 0dae4a3158
commit 284be34a1f

View File

@ -918,13 +918,13 @@ configure_net_static() {
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} Failed to bring $dev interface." ${MSGBOXSIZE}
return 1
fi
echo "running: ip addr add $ip dev $dev"
echo "running: ip addr add $ip dev $dev" >$LOG
ip addr add $ip dev $dev >$LOG 2>&1
if [ $? -ne 0 ]; then
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} Failed to set ip to the $dev interface." ${MSGBOXSIZE}
return 1
fi
ip route add $gw dev $dev >$LOG 2>&1
ip route add default via $gw >$LOG 2>&1
if [ $? -ne 0 ]; then
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} failed to setup your gateway." ${MSGBOXSIZE}
return 1