Add 'sb-wg' script
This commit is contained in:
12
.bin/sb-wg
Executable file
12
.bin/sb-wg
Executable 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
|
||||||
Reference in New Issue
Block a user