Add USB Hotspot

Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:
Maxim Karasev 2021-09-04 23:22:38 +03:00 committed by Stacy Harper
parent a5799bf351
commit 2e965453c1
No known key found for this signature in database
GPG key ID: 5BAC92328B7C5D65

View file

@ -86,6 +86,20 @@ addnetworkwpamenu() {
802-11-wireless-security.psk "$PASSPHRASE" 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() { networksmenu() {
while true; do while true; do
@ -95,6 +109,7 @@ networksmenu() {
Add a GSM Network Add a GSM Network
Add a WPA Network Add a WPA Network
Add a Hotspot Add a Hotspot
Add a USB Hotspot
Delete a Network Delete a Network
Launch Nmtui Launch Nmtui
Launch Ifconfig Launch Ifconfig
@ -120,6 +135,9 @@ networksmenu() {
"Add a Hotspot" ) "Add a Hotspot" )
sxmo_hotspot.sh sxmo_hotspot.sh
;; ;;
"Add a USB Hotspot")
addhotspotusbmenu
;;
"Delete a Network" ) "Delete a Network" )
deletenetworkmenu deletenetworkmenu
;; ;;