Page MenuHomeFreeBSD

bsdinstall netconfig_ipv4: replace dialog(1) with bsddialog(1)
ClosedPublic

Authored by asiciliano on May 20 2022, 1:35 AM.
Tags
None
Referenced Files
F103119823: D35267.diff
Thu, Nov 21, 6:48 AM
Unknown Object (File)
Tue, Oct 29, 1:57 AM
Unknown Object (File)
Sat, Oct 26, 2:24 PM
Unknown Object (File)
Oct 18 2024, 5:06 AM
Unknown Object (File)
Oct 17 2024, 2:10 PM
Unknown Object (File)
Oct 6 2024, 11:19 PM
Unknown Object (File)
Oct 5 2024, 3:44 PM
Unknown Object (File)
Oct 3 2024, 12:14 AM
Subscribers

Details

Summary

Replace dialog(1) with bsddialog(1).

Test Plan

The new use case is only "--form ". Testing:

#!/bin/sh

: ${BSDDIALOG_OK=0}
: ${BSDDIALOG_CANCEL=1}

# My interface
INTERFACE=wlan99

IP_ADDRESS=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $2); }'`
NETMASK=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $4); }'`
ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'`

exec 3>&1
IF_CONFIG=$(bsddialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \
	'IP Address' 1 1 "$IP_ADDRESS" 1 20 16 0 \
	'Subnet Mask' 2 1 "$NETMASK" 2 20 16 0 \
	'Default Router' 3 1 "$ROUTER" 3 20 16 0 \
2>&1 1>&3)
if [ $? -eq $BSDDIALOG_CANCEL ]; then exit 1; fi
exec 3>&-

echo $INTERFACE $IF_CONFIG

% ./test_netconfig_iv4

           ┌───────┤Network Configuration├───────┐
           │ Static Network Interface            │  
           │ Configuration                       │  
           │┌───────────────────────────────────┐│  
           ││IP Address         192.168.1.3     ││  
           ││Subnet Mask        0xffffff00      ││  
           ││Default Router     192.168.1.1     ││  
           │└───────────────────────────────────┘│  
           ├─────────────────────────────────────┤  
           │         [  OK  ]   [Cancel]         │  
           └─────────────────────────────────────┘  
                                                    



wlan99 192.168.1.3 0xffffff00 192.168.1.1

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable