void-bash-installer/files/nm/30-wg0

20 lines
340 B
Bash
Executable File

#!/bin/sh
INTERFACE=$1
ACTION=$2
if [ -f /etc/wirdeguard/wg0.conf ]; then
if [ ! "$INTERFACE" = "wg0" ]; then
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
fi
fi