diff options
| author | Michael Biebl <biebl@debian.org> | 2023-10-17 23:18:14 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-10-18 14:23:37 +0200 |
| commit | 0fbfebd3a199dde0407321adfa9ecde67af5dc92 (patch) | |
| tree | 188992504496491676b8619c19c8b1d040405d41 /debian/01-ifupdown | |
| parent | 7d36e835058da86a8a01bcce1aaa0b0d49f771b6 (diff) | |
Stop executing ifupdown hook scripts on network state changes
Many of those script are not meant to be run within a NetworkManager context. Packages that would benefit from reacting on such network state changes should install a native NetworkManager-dispatcher script. The interface is documented in more detail in the NetworkManager-dispatcher(8) man page.
Diffstat (limited to 'debian/01-ifupdown')
| -rwxr-xr-x | debian/01-ifupdown | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/debian/01-ifupdown b/debian/01-ifupdown deleted file mode 100755 index 5ac31f07..00000000 --- a/debian/01-ifupdown +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -e -# Script to dispatch NetworkManager events -# -# Runs ifupdown scripts when NetworkManager fiddles with interfaces. -# See NetworkManager(8) for further documentation of the dispatcher events. - -# We do not handle connectivity-change events in ifupdown so simply exit at -# this point -if [ "$2" = "connectivity-change" ]; then - exit 0; -fi - -if [ -z "$1" ]; then - echo "$0: called with no interface" 1>&2 - exit 1; -fi - -if [ -n "$IP4_NUM_ADDRESSES" ] && [ "$IP4_NUM_ADDRESSES" -gt 0 ]; then - ADDRESS_FAMILIES="$ADDRESS_FAMILIES inet" -fi -if [ -n "$IP6_NUM_ADDRESSES" ] && [ "$IP6_NUM_ADDRESSES" -gt 0 ]; then - ADDRESS_FAMILIES="$ADDRESS_FAMILIES inet6" -fi - -# If we have a VPN connection ignore the underlying IP address(es) -if [ "$2" = "vpn-up" ] || [ "$2" = "vpn-down" ]; then - ADDRESS_FAMILIES="" -fi - -if [ -n "$VPN_IP4_NUM_ADDRESSES" ] && [ "$VPN_IP4_NUM_ADDRESSES" -gt 0 ]; then - ADDRESS_FAMILIES="$ADDRESS_FAMILIES inet" -fi -if [ -n "$VPN_IP6_NUM_ADDRESSES" ] && [ "$VPN_IP6_NUM_ADDRESSES" -gt 0 ]; then - ADDRESS_FAMILIES="$ADDRESS_FAMILIES inet6" -fi - -# We're probably bringing the interface down. -[ -n "$ADDRESS_FAMILIES" ] || ADDRESS_FAMILIES="inet" - -# Fake ifupdown environment -export IFACE="$1" -export LOGICAL="$1" -export METHOD="NetworkManager" -export VERBOSITY="0" - -for i in $ADDRESS_FAMILIES; do - - export ADDRFAM="$i" - - # Run the right scripts - case "$2" in - up|vpn-up) - export MODE="start" - export PHASE="post-up" - run-parts /etc/network/if-up.d - ;; - down|vpn-down) - export MODE="stop" - export PHASE="post-down" - run-parts /etc/network/if-post-down.d - ;; -# pre-up/pre-down not implemented. See -# https://bugzilla.gnome.org/show_bug.cgi?id=387832 -# pre-up) -# export MODE="start" -# export PHASE="pre-up" -# run-parts /etc/network/if-pre-up.d -# ;; -# pre-down) -# export MODE="stop" -# export PHASE="pre-down" -# run-parts /etc/network/if-down.d -# ;; - hostname|dhcp4-change|dhcp6-change) - # Do nothing - ;; - *) - echo "$0: called with unknown action \`$2'" 1>&2 - exit 1 - ;; - esac -done |