File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -946,7 +946,7 @@ def dhcp_range(arg):
946946 parser .add_argument (
947947 "--ap-driver" , help = "The driver to use for the hostapd, defaults to nl80211"
948948 )
949- parser .add_argument ("--ap-ssid" , help = "SSID of the AP wifi" )
949+ parser .add_argument ("--ap-ssid" , help = "SSID of the AP wifi, defaults to the system hostname " )
950950 parser .add_argument (
951951 "--ap-psk" ,
952952 help = "Passphrase with which to secure the AP wifi, defaults to creation of an unsecured wifi" ,
@@ -1103,8 +1103,12 @@ def dhcp_range(arg):
11031103 if args .ap_ssid :
11041104 config ["ap" ]["ssid" ] = args .ap_ssid
11051105 else :
1106- # Default SSID should be the hostname
1107- config ["ap" ]["ssid" ] = socket .gethostname ()
1106+ try :
1107+ import socket
1108+ # Default SSID should be the hostname
1109+ config ["ap" ]["ssid" ] = socket .gethostname ()
1110+ except Exception :
1111+ parse .error ("Failed to read system hostname" )
11081112 if args .ap_psk :
11091113 config ["ap" ]["psk" ] = args .ap_psk
11101114 if args .ap_channel :
You can’t perform that action at this time.
0 commit comments