Add an automated way to configure a hostspot network

Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
noneofyourbusiness 2021-05-20 16:26:12 +02:00 committed by Stacy Harper
parent f361cf7139
commit 500a227d05
No known key found for this signature in database
GPG key ID: 5BAC92328B7C5D65
2 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,37 @@
#!/usr/bin/env sh
while [ -z "$SSID" ]; do
SSID="$(
echo "$ENTRIES" | sxmo_dmenu_with_kb.sh -c -p "SSID"
)"
done
while [ -z "$key" ]; do
key="$(
echo "$ENTRIES" | sxmo_dmenu_with_kb.sh -c -p "pass"
)"
done
while [ -z "$key1" ]; do
key1="$(
echo "$ENTRIES" | sxmo_dmenu_with_kb.sh -c -p "confirm"
)"
done
if [ "$key" != "$key1" ]; then
notify-send key mismatch
exit 2
fi
while [ -z "$channel" ]; do
channel="$(
echo "11" | sxmo_dmenu_with_kb.sh -l 1 -c -p "channels"
)"
done
if [ -z "$SSID" ] || [ -z "$key" ]; then
notify-send either SSID: "$SSID" or key are empty
exit 3
fi
notify-send "$(nmcli device wifi hotspot ifname wlan0 con-name "Hotspot $SSID" ssid "$SSID" channel "$channel" band bg password "$key")"

View file

@ -94,6 +94,7 @@ networksmenu() {
$(connections)
Add a GSM Network
Add a WPA Network
Add a Hotspot
Delete a Network
Launch Nmtui
Launch Ifconfig
@ -116,6 +117,9 @@ networksmenu() {
"Add a WPA Network" )
addnetworkwpamenu
;;
"Add a Hotspot" )
sxmo_hotspot.sh
;;
"Delete a Network" )
deletenetworkmenu
;;