summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2020-11-17 21:21:06 +0000
committerRobby Workman <rworkman@slackware.com>2021-02-27 23:47:58 -0600
commit856b3e0562dba2042aa1e375de15690197e0a75a (patch)
treecdfc32d5300dd292834db1d3a398323e1efc5b85
parentca2c2ff6ce2b0be389e7041837178a3304bebc73 (diff)
downloadslacknetsetup-856b3e0562dba2042aa1e375de15690197e0a75a.tar.xz
Update VLAN syntax checking. Add quotes in rc.inet1.conf.
-rw-r--r--netconfig35
-rw-r--r--rc.inet1.conf6
2 files changed, 26 insertions, 15 deletions
diff --git a/netconfig b/netconfig
index f314c4e..210c8a4 100644
--- a/netconfig
+++ b/netconfig
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# A script to do basic network configuration.
# Mostly written by Patrick Volkerding <volkerdi@slackware.com>.
# Modified to use /etc/rc.d/rc.inet1.conf Tue Aug 26 16:51:48 PDT 2003 <pjv>
@@ -229,7 +229,7 @@ GATEWAY6="$GATEWAY6"
#MTU[4]="" # The default MTU is 1500, but you might need
# 1360 when you use NAT'ed IPSec traffic.
#PROMISCUOUS[4]="yes" # Set promiscuous mode on the interface.
-#DHCP_TIMEOUT[4]=15 # The default timeout for the DHCP client to
+#DHCP_TIMEOUT[4]="15" # The default timeout for the DHCP client to
# wait for server resonse is 15 seconds, but
# you might want a shorter or longer wait.
#DHCP_KEEPRESOLV[4]="yes" # If you don't want /etc/resolv.conf overwritten
@@ -248,7 +248,7 @@ GATEWAY6="$GATEWAY6"
# Increase the timeout if required.
#USE_RA[4]="yes" # Accept router advertisements even when SLAAC
# is disabled on the interface.
-#WLAN_ESSID[4]=DARKSTAR # An example of how you can override _any_
+#WLAN_ESSID[4]="DARKSTAR" # An example of how you can override _any_
# parameter defined in rc.wireless.conf, by
# prepending 'WLAN_' to the parameter's name.
# Useful with multiple wireless interfaces.
@@ -262,7 +262,7 @@ GATEWAY6="$GATEWAY6"
#WLAN_WPADRIVER[4]="ndiswrapper"# Tell wpa_supplicant to specifically use the
# ndiswrapper driver (if you leave this empty
# the 'wext' driver is used by default)
-#WLAN_WPAWAIT[4]=30 # In case it takes long for the WPA association
+#WLAN_WPAWAIT[4]="30" # In case it takes long for the WPA association
# to finish, you can increase the wait time
# (defaults to 10 seconds)
@@ -480,21 +480,32 @@ dialog --title "CONNECT VIA VLAN" --defaultno --yesno \
"Some advanced networking set ups require a VLAN ID in order to \
connect to the network. Do you wish to configure a VLAN now? \n\n\
Unless you are sure you require a VLAN, select 'No'." 8 68
-if [ $? = 0 ]; then
+ERRNO="$?"
+if [ "$ERRNO" = "255" ]; then
+ exit
+elif [ "$ERRNO" = "1" ]; then
+ true
+else
while true; do
dialog --title "VLAN ID" --cancel-label "Skip" --inputbox \
- "Enter the VLAN ID used on this network." 8 45 2>$TMP/reply
- if [ $? = 0 ]; then
- if ! (($(cat $TMP/reply))) 2>/dev/null; then
+ "Enter the VLAN ID used on this network:" 8 45 2>$TMP/reply
+ ERRNO="$?"
+ if [ "$ERRNO" = "255" ]; then
+ exit
+ elif [ "$ERRNO" = "1" ]; then
+ break
+ else
+ if [[ ! "$(cat $TMP/reply)" =~ ^[0-9]+$ ]]; then
dialog --title "VLAN ID" --ok-button "Back" --msgbox \
- "That doesn't appear to be a valid VLAN ID." 5 46
+ "That doesn't appear to be a valid VLAN ID." 5 46
+ if [ "$?" = "255" ]; then
+ exit
+ fi
continue
else
- VLAN=".`cat $TMP/reply`"
+ VLAN=".$(( 10#$(cat $TMP/reply) ))"
break
fi
- else
- break
fi
done
fi
diff --git a/rc.inet1.conf b/rc.inet1.conf
index 48b94db..5def0a8 100644
--- a/rc.inet1.conf
+++ b/rc.inet1.conf
@@ -192,7 +192,7 @@ GATEWAY6=""
#MTU[4]="" # The default MTU is 1500, but you might need
# 1360 when you use NAT'ed IPSec traffic.
#PROMISCUOUS[4]="yes" # Set promiscuous mode on the interface.
-#DHCP_TIMEOUT[4]=15 # The default timeout for the DHCP client to
+#DHCP_TIMEOUT[4]="15" # The default timeout for the DHCP client to
# wait for server resonse is 15 seconds, but
# you might want a shorter or longer wait.
#DHCP_KEEPRESOLV[4]="yes" # If you don't want /etc/resolv.conf overwritten
@@ -211,7 +211,7 @@ GATEWAY6=""
# Increase the timeout if required.
#USE_RA[4]="yes" # Accept router advertisements even when SLAAC
# is disabled on the interface.
-#WLAN_ESSID[4]=DARKSTAR # An example of how you can override _any_
+#WLAN_ESSID[4]="DARKSTAR" # An example of how you can override _any_
# parameter defined in rc.wireless.conf, by
# prepending 'WLAN_' to the parameter's name.
# Useful with multiple wireless interfaces.
@@ -225,7 +225,7 @@ GATEWAY6=""
#WLAN_WPADRIVER[4]="ndiswrapper"# Tell wpa_supplicant to specifically use the
# ndiswrapper driver (if you leave this empty
# the 'wext' driver is used by default)
-#WLAN_WPAWAIT[4]=30 # In case it takes long for the WPA association
+#WLAN_WPAWAIT[4]="30" # In case it takes long for the WPA association
# to finish, you can increase the wait time
# (defaults to 10 seconds)