Add 'sb-wg' script

master
Hektor Misplon 2025-01-28 19:25:56 +01:00
parent 733b37de30
commit f858f7374b
1 changed files with 12 additions and 0 deletions

12
.bin/sb-wg Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env sh
# Reference: https://github.com/mil-ad/polybar-wireguard
connected_interfaces=$(networkctl | grep -P "\d+ .* wireguard routable" -o | cut -d" " -f2)
if [ -n "$connected_interfaces" ];
then
for interface in $connected_interfaces; do echo "$interface"; done
else
exit 1
fi