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
Unknown Object (File)
Wed, Sep 24, 8:47 AM
Unknown Object (File)
Sep 10 2025, 2:01 AM
Unknown Object (File)
Sep 9 2025, 11:40 PM
Unknown Object (File)
Sep 5 2025, 12:43 PM
Unknown Object (File)
Aug 21 2025, 8:15 PM
Unknown Object (File)
Aug 19 2025, 12:12 AM
Unknown Object (File)
Aug 14 2025, 11:41 PM
Unknown Object (File)
Jul 30 2025, 3:58 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