wifi-off/termux.sh

14 lines
463 B
Bash
Executable File

#!/data/data/com.termux/files/usr/bin/env bash
connection_info=$(termux-wifi-connectioninfo)
ip_address=$(echo "$connection_info" | jq -r .ip)
if [ "$ip_address" != "192.168.178.3" ]; then
termux-notification -c "Not trying to turn of wifi, as you are not at home"
exit 1 # You can choose to exit the script or add other error-handling logic
fi
cd ~/wifi-off/
export FRITZ_PASSWORD="your_password"
make run && termux-notification -c "Turned of wifi"