ifupdown-ng/executor-scripts/linux/wireguard

16 lines
321 B
Text
Raw Permalink Normal View History

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