From 7ab189e99c9c697d362d6bbf5ae213c0a7e20ad2 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Fri, 23 Jan 2026 13:10:26 +1100 Subject: [PATCH] =?utf8?q?Activates=20of=20Will=20Budi=C4=87=20specific=20?= =?utf8?q?hotspot=20on=20the=20wifi=20card.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- hotspot_activate.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 hotspot_activate.sh diff --git a/hotspot_activate.sh b/hotspot_activate.sh new file mode 100755 index 0000000..58d6250 --- /dev/null +++ b/hotspot_activate.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +### +# Activates of Will Budić specific hotspot on the wifi card. +# +# Requirements: sdo apt install libgdal-dev, nmcli, vnstat +# sudo systemctl enable vnstat +# sudo systemctl start vnstat +### +result=$(nmcli radio wifi) +echo "[$result]" +if [ "$result" == "disabled" ]; then + nmcli radio wifi on; + echo -e "Switched on wifi!\n" +fi +result=$(nmcli con show Hotspot | awk '/ipv4.addresses/ { print $2}'); +if [ "$result" != "10.42.0.1/24" ]; then + nmcli con down Hotspot + sudo nmcli con mod Hotspot ipv4.addresses "10.42.0.1/24"; + echo -e "Changed to mobile compatible host connection address!\n"; +fi + +nmcli con up Hotspot +nmcli -p -f general,wifi-properties device show wlp0s20f3 + +vnstat -tr -l wlp0s20f3 -- 2.34.1