add wireguard executor script
This commit is contained in:
parent
471549db4b
commit
f32481deb9
2 changed files with 18 additions and 1 deletions
3
Makefile
3
Makefile
|
@ -84,7 +84,8 @@ EXECUTOR_SCRIPTS_OPT ?= \
|
|||
bridge \
|
||||
vrf \
|
||||
tunnel \
|
||||
gre
|
||||
gre \
|
||||
wireguard
|
||||
|
||||
EXECUTOR_SCRIPTS ?= ${EXECUTOR_SCRIPTS_CORE} ${EXECUTOR_SCRIPTS_OPT}
|
||||
|
||||
|
|
16
executor-scripts/linux/wireguard
Executable file
16
executor-scripts/linux/wireguard
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
[ -n "$VERBOSE" ] && set -x
|
||||
[ -z "$IF_WIREGUARD_CONFIG_PATH" ] && IF_WIREGUARD_CONFIG_PATH="/etc/wireguard/$IFACE.conf"
|
||||
|
||||
case "$PHASE" in
|
||||
pre-up)
|
||||
${MOCK} ip link add $IFACE type wireguard
|
||||
${MOCK} wg setconf $IFACE $IF_WIREGUARD_CONFIG_PATH
|
||||
;;
|
||||
post-down)
|
||||
${MOCK} ip link delete dev $IFACE
|
||||
;;
|
||||
esac
|
Loading…
Reference in a new issue