This commit is contained in:
William Mantly 2022-11-17 21:33:23 -05:00
parent a27975e3b4
commit 3b14de2e60
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1 @@
`apt install alltray`

3
watch_wg.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
watch --color WG_COLOR_MODE=always wg

BIN
wg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

12
wifi-wg.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Auto WiFi Wireguard connect
After=network.target
StartLimitIntervalSec=0
[Service]
Environment="DISPLAY=:0"
Restart=always
ExecStart=sudo wpa_cli -i wlo1 -a /home/william/wpa.sh
[Install]
WantedBy=graphical.target

27
wpa.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# redirect all output into a logfile
# exec 1>> /tmp/test.log 2>&1
case "$2" in
CONNECTED)
# do stuff on connect with wlan0
sleep 2;
if grep -Fxq `iwgetid --ap --raw` /etc/theta_wg/ignore.txt
then
echo "none"
else
# code if not found
wg-quick up wg0-ron
fi
;;
DISCONNECTED)
# do stuff on disconnect with wlan0
wg-quick down wg0-ron
;;
*)
>&2 echo empty or undefined event for wlan0: "$2"
exit 1
;;
esac