mirror of
https://github.com/dzaczek/Uconsole-i3.git
synced 2025-12-18 01:39:39 +00:00
initial commit
This commit is contained in:
commit
81b9fd515f
7 changed files with 789 additions and 0 deletions
21
scripts/rpiwireguard.sh
Executable file
21
scripts/rpiwireguard.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Define the WireGuard interface
|
||||
WG_INTERFACE="wg0"
|
||||
|
||||
# Define shield icons
|
||||
ICON_UP="<span color='green'></span>" # Shield (use your desired icon)
|
||||
ICON_DOWN="<span color='red'></span>" # Shield (use your desired icon)
|
||||
|
||||
# Check if the WireGuard interface is active
|
||||
if ip link show dev "$WG_INTERFACE" &> /dev/null; then
|
||||
# Check if there are any established peer connections
|
||||
if [ "$(wg show "$WG_INTERFACE" endpoints | wc -l)" -gt 0 ]; then
|
||||
echo "WG: $ICON_UP Connected"
|
||||
else
|
||||
echo "WG: $ICON_DOWN No Peers"
|
||||
fi
|
||||
else
|
||||
echo "WG: $ICON_DOWN Down"
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue