From: Will Budic Date: Fri, 23 Jan 2026 02:10:26 +0000 (+1100) Subject: Activates of Will Budić specific hotspot on the wifi card. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=7ab189e99c9c697d362d6bbf5ae213c0a7e20ad2;p=wb-shell-scripts.git Activates of Will Budić specific hotspot on the wifi card. --- 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