最后活跃于 1705433148

NetworkManager dispatcher script to restart Wireguard interface on connection change

修订 05235feda266677263f575eb8a67ccf38a872123

gistfile1.txt 原始文件
1#!/bin/bash
2
3##
4## Reloads Wireguard tunnel when an interface change happens
5## Intended for use with always active full tunnels
6## Place in /etc/NetworkManager/dispatcher.d, change permissions
7## to 755 and enter your interface name to WG_INTERFACE
8## (e.g. WG_INTERFACE='wg0')
9##
10
11WG_INTERFACE=''
12
13if [[ "$1" != "$WG_INTERFACE" ]] && [[ "$2" == "up" ]]; then
14 echo "running $0" | systemd-cat -t nm-dispatcher
15 sleep 2
16 nmcli conn up $WG_INTERFACE
17fi
18
19exit 0