Wireguard automation scripts with network namespace
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wg-down.sh 357B

12345678910111213
  1. #!/bin/bash
  2. CONFIG_NAME="$1"
  3. #DEV_NAME="$2"
  4. source ${BASH_SOURCE%/*}/ext/$CONFIG_NAME.conf
  5. #ip netns exec $CONFIG_NAME ip link del dev $DEV_NAME
  6. #ip netns exec $CONFIG_NAME wg-quick down $CONFIG_NAME
  7. if $PRIVATE_VETH_ENABLED; then
  8. ip netns exec $CONFIG_NAME ip link del dev "$CONFIG_NAME"1
  9. ip link del dev "$CONFIG_NAME"0
  10. fi
  11. ip netns del $CONFIG_NAME