add preview screenshot
This commit is contained in:
parent
796176480e
commit
a304926231
7 changed files with 47 additions and 1 deletions
20
home/config/scripts/wgStatus.sh
Executable file
20
home/config/scripts/wgStatus.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
INTERFACE="wg0"
|
||||
|
||||
if [ "$1" = "toggle" ]; then
|
||||
if ip link show "$INTERFACE" >/dev/null 2>&1; then
|
||||
pkexec wg-quick down "$INTERFACE"
|
||||
else
|
||||
pkexec wg-quick up "$INTERFACE"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! ip link show "$INTERFACE" >/dev/null 2>&1; then
|
||||
echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}"
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue