24 lines
379 B
Bash
Executable File
24 lines
379 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
|
|
#wg set wg0 peer ZJwTV2l+N+vFwL0KFQb5xpAPqwVcf0YvEMFzTaIoAU8= endpoint home.rotce.de:51820
|
|
;;
|
|
down)
|
|
wg-quick down wg0
|
|
#ip link delete dev wg0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
fi
|