1
0
Fork 0
This commit is contained in:
Arthur K. 2025-03-15 13:52:06 +03:00
parent 365e0feddc
commit ce19d6a62c
Signed by: wzray
GPG key ID: B97F30FDC4636357
24 changed files with 212 additions and 96 deletions

View file

@ -1,7 +1,19 @@
#!/bin/bash
IFNAME="$(ip link show | grep 'wg_' | cut -d ' ' -f 2 | sed 's/://' | sed 's/wg_//' | tr '[:lower:]' '[:upper:]' | sed 's/_D/ (dpi)/')"
if [ -n "${IFNAME}" ]; then
echo "󰦝 ${IFNAME}"
PIPE="/var/run/vpnd.sock"
send_cmd() {
[ -p $PIPE ] && echo "$@" > $PIPE && \
cat < $PIPE
}
IFNAME="$(send_cmd status)"
case "$IFNAME" in
"msk") IFNAME="Moscow";;
"rix") IFNAME="Riga";;
esac
if [ -n "$IFNAME" ]; then
echo "󰦝 $IFNAME"
fi