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
|
2020-09-09 22:48:35 +00:00
|
|
|
create)
|
2020-09-04 18:57:41 +00:00
|
|
|
${MOCK} ip link add $IFACE type wireguard
|
2020-09-09 22:48:35 +00:00
|
|
|
;;
|
|
|
|
pre-up)
|
2020-09-04 18:57:41 +00:00
|
|
|
${MOCK} wg setconf $IFACE $IF_WIREGUARD_CONFIG_PATH
|
|
|
|
;;
|
2020-09-09 22:48:35 +00:00
|
|
|
destroy)
|
2020-09-04 18:57:41 +00:00
|
|
|
${MOCK} ip link delete dev $IFACE
|
|
|
|
;;
|
|
|
|
esac
|