ifupdown-ng/executor-scripts/linux/wireguard
2020-11-02 08:53:30 -07:00

15 lines
321 B
Bash
Executable file

#!/bin/sh
[ -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