22 lines
249 B
Bash
Executable File
22 lines
249 B
Bash
Executable File
#!/bin/sh
|
|
INTERFACE=$1
|
|
ACTION=$2
|
|
|
|
if [ -f /etc/wireguard/wg0.conf ]; then
|
|
case "$INTERFACE" in
|
|
tun*|wg*)
|
|
exit 0
|
|
;;
|
|
*)
|
|
case "$ACTION" in
|
|
up)
|
|
wg-quick up wg0
|
|
;;
|
|
down)
|
|
wg-quick down wg0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
fi
|