summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2020-11-27 16:54:42 +0000
committerRobby Workman <rworkman@slackware.com>2021-02-27 23:47:58 -0600
commit6a0079608d35d483d99987f498041d4da798b7d3 (patch)
treef53fedc2fcf0694a6919a80fc33700d9ff47234e
parentce4b33c151b661b27c50ad1c38b639ff9f90e6a1 (diff)
downloadslacknetsetup-6a0079608d35d483d99987f498041d4da798b7d3.tar.xz
Don't skip VLAN entry if it's empty + more
Change a couple of button text to 'Exit'. Allow canceling out of DHCP hostname prompt.
-rw-r--r--netconfig22
1 files changed, 10 insertions, 12 deletions
diff --git a/netconfig b/netconfig
index 82bb9ef..71b267b 100644
--- a/netconfig
+++ b/netconfig
@@ -544,11 +544,6 @@ else
else
VLAN="$(cat $TMP/reply)"
echo "$VLAN" >$TMP/SeTVLAN
- if [ "$VLAN" = "" ]; then
- unset VLAN
- rm -f $TMP/SeTVLAN
- break
- fi
if [[ ! "$VLAN" =~ ^[0-9]+$ ]]; then
dialog --title "VLAN ID" --ok-button "Back" --msgbox \
"That doesn't appear to be a valid VLAN ID." 5 46
@@ -566,7 +561,7 @@ else
fi
dialog --title "CONFIGURATION TYPE FOR '$HOSTNM.$DOMAIN'" \
---default-item NetworkManager \
+--default-item NetworkManager --cancel-button "Exit" \
--menu \
"Now we need to know how your machine connects to the network.\n\
If you have an internal network card and an assigned IP address, gateway, \
@@ -590,7 +585,8 @@ REPLY=`cat $TMP/reply`
rm -f $TMP/reply
if [ "$REPLY" = "DHCP" ]; then
- dialog --title "SELECT DHCP TYPE" --default-item "DHCPv4" --menu \
+ dialog --title "SELECT DHCP TYPE" --default-item "DHCPv4" \
+ --cancel-button "Exit" --menu \
"Please select the type of DHCP to use to configure your networking.
Select 'DHCPv4' to configure for an IPv4 network (this is the most
common type of network, and the safe choice). Select 'DHCPv6' for a
@@ -616,15 +612,17 @@ pure IPv6 network, or 'Both' to try and set up both types of network." 13 73 3 \
that the DHCP hostname be set in order to connect. If so, they'll have assigned \
a hostname to your machine, which may look something like CC-NUMBER-A (this \
depends on your ISP). If you were assigned a DHCP hostname, please enter it \
-below. If you do not have a DHCP hostname, just leave it blank or select 'Skip'." 13 62 \
+below. If you do not have a DHCP hostname, just leave it blank or select 'Skip'." 13 67 \
2> $TMP/SeTDHCPHOST
- if [ "$?" = "255" ]; then
+ ERRNO="$?"
+ if [ "$ERRNO" = "255" ]; then
+ rm -f $TMP/SeTDHCPHOST
exit
+ elif [ "$ERRNO" = "0" ]; then
+ # OK, if we actually got something, use it.
+ DHCP_HOSTNAME="$(cat $TMP/SeTDHCPHOST)"
fi
- NEW_DHCPHOST="`cat $TMP/SeTDHCPHOST`"
rm -f $TMP/SeTDHCPHOST
- # OK, if we actually got something, use it.
- DHCP_HOSTNAME="$NEW_DHCPHOST"
elif [ "$REPLY" = "loopback" ]; then
LOOPBACK="yes"
elif [ "$REPLY" = "NetworkManager" ]; then