ifupdown-ng/executor-scripts/linux/wireguard
Maximilian Wilhelm af94d760d0 Update executors to reflect new create/destroy phase.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-09-10 00:48:47 +02:00

18 lines
330 B
Bash
Executable file

#!/bin/sh
set -e
[ -n "$VERBOSE" ] && set -x
[ -z "$IF_WIREGUARD_CONFIG_PATH" ] && IF_WIREGUARD_CONFIG_PATH="/etc/wireguard/$IFACE.conf"
case "$PHASE" in
create)
${MOCK} ip link add $IFACE type wireguard
;;
pre-up)
${MOCK} wg setconf $IFACE $IF_WIREGUARD_CONFIG_PATH
;;
destroy)
${MOCK} ip link delete dev $IFACE
;;
esac