Skip to content

Commit 9108d98

Browse files
committed
Allow ssid to be set in the config file.
1 parent 46115cf commit 9108d98

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

netconnectd/server.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,13 +1102,6 @@ def dhcp_range(arg):
11021102
config["ap"]["driver"] = args.ap_driver
11031103
if args.ap_ssid:
11041104
config["ap"]["ssid"] = args.ap_ssid
1105-
else:
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")
11121105
if args.ap_psk:
11131106
config["ap"]["psk"] = args.ap_psk
11141107
if args.ap_channel:
@@ -1152,9 +1145,12 @@ def dhcp_range(arg):
11521145
"Wifi interface is missing, supply with either --interface-wifi or via config file"
11531146
)
11541147
if not config["ap"]["ssid"]:
1155-
parser.error(
1156-
"AP SSID is missing, supply with either --ap-ssid or via config file"
1157-
)
1148+
try:
1149+
import socket
1150+
# Default SSID should be the hostname
1151+
config["ap"]["ssid"] = socket.gethostname()
1152+
except Exception:
1153+
parse.error("Failed to read system hostname")
11581154

11591155
if args.foreground:
11601156
# start directly instead of as daemon

0 commit comments

Comments
 (0)