Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit bd21ded

Browse files
author
Ihor Savchenko
committed
add passwordless access point
1 parent 3f15281 commit bd21ded

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99

1010
// defaults
1111
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 || '';
1313
const WIFI_SSID = process.env.WIFI_SSID;
1414
const WIFI_PASSWORD = process.env.WIFI_PASSWORD;
1515

src/nm.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ export const createAccessPoint = async (device: WirelessNetwork): Promise<any> =
4848
['ssid', ['ay', stringToArrayOfBytes(device.ssid)]],
4949
['mode', ['s', 'ap']],
5050
]],
51-
['802-11-wireless-security', [
52-
['key-mgmt', ['s', 'wpa-psk']],
53-
['psk', ['s', device.password]],
54-
]],
5551
['ipv4', [
5652
['method', ['s', 'shared']],
5753
]],
@@ -60,6 +56,15 @@ export const createAccessPoint = async (device: WirelessNetwork): Promise<any> =
6056
]],
6157
];
6258

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+
6368
const dbusPath = await getPathByIface(device.iface);
6469
const connection = await addConnection(connectionParams);
6570
const result = await activateConnection(connection, dbusPath);

0 commit comments

Comments
 (0)