executor-scripts/linux/wireguard
raw| 1 | #!/bin/sh |
| 2 | [ -n "$VERBOSE" ] && set -x |
| 3 | [ -z "$IF_WIREGUARD_CONFIG_PATH" ] && IF_WIREGUARD_CONFIG_PATH="/etc/wireguard/$IFACE.conf" |
| 4 | |
| 5 | case "$PHASE" in |
| 6 | create) |
| 7 | ${MOCK} ip link add $IFACE type wireguard |
| 8 | ;; |
| 9 | pre-up) |
| 10 | ${MOCK} wg setconf $IFACE $IF_WIREGUARD_CONFIG_PATH |
| 11 | ;; |
| 12 | destroy) |
| 13 | ${MOCK} ip link delete dev $IFACE |
| 14 | ;; |
| 15 | esac |