netcardconfig: default VLAN option to no and ensure 8021q module is loaded
authorMichael Prokop <mika@grml.org>
Fri, 25 May 2018 10:06:52 +0000 (12:06 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 25 May 2018 10:06:52 +0000 (12:06 +0200)
Configuring VLAN is optional and usually not required, so default
to no.

Without the 8021q module being loaded it spills a warning
message, even though it works fine. This might be confusing
for the user though, so let's loaded ahead.

sbin/netcardconfig

index e3d0d11..3a80366 100755 (executable)
@@ -420,10 +420,11 @@ configiface() {
   fi
 
   # Configure VLAN on this interface?
   fi
 
   # Configure VLAN on this interface?
-  if $DIALOG --yesno "$MESSAGE16" 8 45; then
+  if $DIALOG --defaultno --yesno "$MESSAGE16" 8 45; then
     $DIALOG --inputbox "$MESSAGE17 $DV" 10 45 2>"$TMP" || bailout 1
     read -r VLAN <"$TMP" ; rm -f "$TMP"
     if [ -n "$VLAN" ]; then
     $DIALOG --inputbox "$MESSAGE17 $DV" 10 45 2>"$TMP" || bailout 1
     read -r VLAN <"$TMP" ; rm -f "$TMP"
     if [ -n "$VLAN" ]; then
+      modprobe 8021q # avoid warning that VLAN support isn't present yet
       PDV=$DV
       DV="vlan$VLAN"
     fi
       PDV=$DV
       DV="vlan$VLAN"
     fi