Skip to content

Instantly share code, notes, and snippets.

@pvdb458
Created November 7, 2017 15:04
Show Gist options
  • Select an option

  • Save pvdb458/8f245d0e829e10061d0f28f4098b057f to your computer and use it in GitHub Desktop.

Select an option

Save pvdb458/8f245d0e829e10061d0f28f4098b057f to your computer and use it in GitHub Desktop.
#!/bin/bash
#############################
# Ifdown script for WireGuard
#############################
. /etc/init.d/functions
cd /etc/sysconfig/network-scripts
. ./network-functions
[ -f ../network ] && . ../network
CONFIG=${1}
need_config "${CONFIG}"
source_config
ip link del dev ${DEVICE} 2>/dev/null || {
net_log $"WARNING: Device not found. Aborting script"
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment