This commit is contained in:
parent
365e0feddc
commit
ce19d6a62c
24 changed files with 212 additions and 96 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue