From 2e965453c15413dc169825215722838acd888cd1 Mon Sep 17 00:00:00 2001 From: Maxim Karasev Date: Sat, 4 Sep 2021 23:22:38 +0300 Subject: [PATCH] Add USB Hotspot Signed-off-by: Stacy Harper --- scripts/core/sxmo_networks.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/core/sxmo_networks.sh b/scripts/core/sxmo_networks.sh index b4de0cb..fe3d5c7 100755 --- a/scripts/core/sxmo_networks.sh +++ b/scripts/core/sxmo_networks.sh @@ -86,6 +86,20 @@ addnetworkwpamenu() { 802-11-wireless-security.psk "$PASSPHRASE" } +addhotspotusbmenu() { + CONNNAME="$( + echo "Close Menu" | + sxmo_dmenu_with_kb.sh -p "Add USB Hotspot: Alias" + )" + [ "$CONNNAME" = "Close Menu" ] && return + + # TODO: restart udhcpd after disconnecting on postmarketOS + nmcli c add \ + type ethernet \ + ifname usb0 \ + con-name "$CONNNAME" \ + ipv4.method shared +} networksmenu() { while true; do @@ -95,6 +109,7 @@ networksmenu() { Add a GSM Network Add a WPA Network Add a Hotspot + Add a USB Hotspot Delete a Network Launch Nmtui Launch Ifconfig @@ -120,6 +135,9 @@ networksmenu() { "Add a Hotspot" ) sxmo_hotspot.sh ;; + "Add a USB Hotspot") + addhotspotusbmenu + ;; "Delete a Network" ) deletenetworkmenu ;;