diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 02b253d4..99a8fc79 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -1257,13 +1257,16 @@ function change_system_name { } function set_static_IP { - STATIC_IP='192.168.1.60' - STATIC_GATEWAY='192.168.1.1' + IPv4_address=$(get_ipv4_address) + IPv4_address_base=$(echo "$IPv4_address" | awk -F '.' '{print $1"."$2"."$3}') + STATIC_IP="${IPv4_address_base}.60" + STATIC_GATEWAY="${IPv4_address_base}.1" + NEW_STATIC_IP= NEW_STATIC_GATEWAY= if grep -q 'iface eth0 inet static' /etc/network/interfaces; then - STATIC_IP=$(cat /etc/network/interfaces | grep "address " | awk -F ' ' '{print $2}' | head -n 1) - STATIC_GATEWAY=$(cat /etc/network/interfaces | grep "gateway " | awk -F ' ' '{print $2}' | head -n 1) + STATIC_IP=$(cat /etc/network/interfaces | grep "address " | head -n 1 | awk -F ' ' '{print $2}') + STATIC_GATEWAY=$(cat /etc/network/interfaces | grep "gateway " | head -n 1 | awk -F ' ' '{print $2}') fi # get the IP for the box