Init: static ip conf vars are now uppercase

This commit is contained in:
Calin Crisan 2019-01-12 16:28:49 +02:00
parent 92bd4b031d
commit 32f3cb2e9f

View File

@ -76,10 +76,10 @@ start_wlan() {
ip link set mtu $mtu dev $OS_WLAN ip link set mtu $mtu dev $OS_WLAN
fi fi
if [[ -n "$static_ip" ]]; then if [[ -n "$STATIC_IP" ]]; then
msg_done $static_ip msg_done $STATIC_IP
ifconfig $OS_WLAN $static_ip up ifconfig $OS_WLAN $STATIC_IP up
static_ip="" # won't be used again STATIC_IP="" # won't be used again
else else
msg_done dhcp msg_done dhcp
dhclient -cf "$DH_CONF" $OS_WLAN dhclient -cf "$DH_CONF" $OS_WLAN
@ -136,10 +136,10 @@ start_eth() {
ip link set mtu $mtu dev $OS_ETH ip link set mtu $mtu dev $OS_ETH
fi fi
if [[ -n "$static_ip" ]]; then if [[ -n "$STATIC_IP" ]]; then
msg_done $static_ip msg_done $STATIC_IP
ifconfig $OS_ETH $static_ip up ifconfig $OS_ETH $STATIC_IP up
static_ip="" # won't be used again STATIC_IP="" # won't be used again
else else
msg_done dhcp msg_done dhcp
dhclient -cf "$DH_CONF" $OS_ETH dhclient -cf "$DH_CONF" $OS_ETH
@ -185,15 +185,15 @@ start() {
fi fi
fi fi
if [[ -n "$static_gw" ]]; then if [[ -n "$STATIC_GW" ]]; then
msg_begin "Setting static gateway to $static_gw" msg_begin "Setting static gateway to $STATIC_GW"
ip route add default via $static_gw ip route add default via $STATIC_GW
test $? == 0 && msg_done || msg_fail test $? == 0 && msg_done || msg_fail
fi fi
if [[ -n "$static_dns" ]]; then if [[ -n "$STATIC_DNS" ]]; then
msg_begin "Setting static DNS server to $static_dns" msg_begin "Setting static DNS server to $STATIC_DNS"
echo "nameserver $static_dns" > /etc/resolv.conf echo "nameserver $STATIC_DNS" > /etc/resolv.conf
test $? == 0 && msg_done || msg_fail test $? == 0 && msg_done || msg_fail
fi fi
} }