diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2020-11-17 21:21:06 +0000 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2021-02-27 23:47:58 -0600 |
commit | 856b3e0562dba2042aa1e375de15690197e0a75a (patch) | |
tree | cdfc32d5300dd292834db1d3a398323e1efc5b85 /netconfig | |
parent | ca2c2ff6ce2b0be389e7041837178a3304bebc73 (diff) | |
download | slacknetsetup-856b3e0562dba2042aa1e375de15690197e0a75a.tar.xz |
Update VLAN syntax checking. Add quotes in rc.inet1.conf.
Diffstat (limited to 'netconfig')
-rw-r--r-- | netconfig | 35 |
1 files changed, 23 insertions, 12 deletions
@@ -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 |