From 6778b18e8a3550eff78ba4b5a5eb160ad767590c Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Mon, 18 Nov 2019 16:57:48 +0000 Subject: Add VLAN configuration support to netconfig. --- netconfig | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/netconfig b/netconfig index 533f9f4..f8f62f9 100644 --- a/netconfig +++ b/netconfig @@ -42,6 +42,13 @@ fi # ============================================================================= # IPv4 config information for eth0: +ENDFILE + +if [ -n "$VLAN" ]; then + echo "IFNAME[0]=\"eth0$VLAN\"" >>$RC +fi + +/bin/cat << ENDFILE >> $RC IPADDR[0]="$RCIPCOPY" NETMASK[0]="$RCMASKCOPY" IPALIASES[0]="" @@ -466,6 +473,29 @@ echo $HOSTNM.$DOMAIN > etc/HOSTNAME # sed -i "s/^hostname=.*$/hostname=$HOSTNM/g" etc/NetworkManager/NetworkManager.conf #fi +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 + 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 + dialog --title "VLAN ID" --ok-button "Back" --msgbox \ + "That doesn't appear to be a valid VLAN ID." 5 46 + continue + else + VLAN=".`cat $TMP/reply`" + break + fi + else + break + fi + done +fi + dialog --title "CONFIGURATION TYPE FOR '$HOSTNM.$DOMAIN'" \ --default-item NetworkManager \ --menu \ -- cgit v1.2.3