This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
// defaults
11
11
const AP_SSID = process . env . AP_SSID || `WiFi Repeater` ;
12
- const AP_PASSWORD = process . env . AP_PASSWORD || 'charlietheunicorn ' ;
12
+ const AP_PASSWORD = process . env . AP_PASSWORD || '' ;
13
13
const WIFI_SSID = process . env . WIFI_SSID ;
14
14
const WIFI_PASSWORD = process . env . WIFI_PASSWORD ;
15
15
Original file line number Diff line number Diff line change @@ -48,10 +48,6 @@ export const createAccessPoint = async (device: WirelessNetwork): Promise<any> =
48
48
[ 'ssid' , [ 'ay' , stringToArrayOfBytes ( device . ssid ) ] ] ,
49
49
[ 'mode' , [ 's' , 'ap' ] ] ,
50
50
] ] ,
51
- [ '802-11-wireless-security' , [
52
- [ 'key-mgmt' , [ 's' , 'wpa-psk' ] ] ,
53
- [ 'psk' , [ 's' , device . password ] ] ,
54
- ] ] ,
55
51
[ 'ipv4' , [
56
52
[ 'method' , [ 's' , 'shared' ] ] ,
57
53
] ] ,
@@ -60,6 +56,15 @@ export const createAccessPoint = async (device: WirelessNetwork): Promise<any> =
60
56
] ] ,
61
57
] ;
62
58
59
+ if ( device . password ) {
60
+ connectionParams . push (
61
+ [ '802-11-wireless-security' , [
62
+ [ 'key-mgmt' , [ 's' , 'wpa-psk' ] ] ,
63
+ [ 'psk' , [ 's' , device . password ] ] ,
64
+ ] ]
65
+ ) ;
66
+ }
67
+
63
68
const dbusPath = await getPathByIface ( device . iface ) ;
64
69
const connection = await addConnection ( connectionParams ) ;
65
70
const result = await activateConnection ( connection , dbusPath ) ;
You can’t perform that action at this time.
0 commit comments