]> lifelog.hopto.org Git - wb-shell-scripts.git/commitdiff
Activates of Will Budić specific hotspot on the wifi card.
authorWill Budic <redacted>
Fri, 23 Jan 2026 02:10:26 +0000 (13:10 +1100)
committerWill Budic <redacted>
Fri, 23 Jan 2026 02:10:26 +0000 (13:10 +1100)
hotspot_activate.sh [new file with mode: 0755]

diff --git a/hotspot_activate.sh b/hotspot_activate.sh
new file mode 100755 (executable)
index 0000000..58d6250
--- /dev/null
@@ -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