HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //usr/lib/ubuntu-fan/fan-net
#!/bin/sh -

#
# All interfaces managed by ifupdown get their Fan bridges configured by
# the ifupdown hook, so here we only care about interfaces controlled by
# systemd-networkd (FIXME: Networkmanager?)
#
networkd_interfaces() {
	if [ "$(type networkctl 2>&1|grep 'not found')" != "" ]; then
		return
	fi
	networkctl 2>/dev/null |
		awk '$4=="routable" && $5=="configured"{print $2}'
}
networkd_cmd() {
	local CMD="$1"
	local IFACE

	for IFACE in $(networkd_interfaces); do
		fanctl net $CMD $IFACE
	done
}

# See how we were called.
case "$1" in
    start)
        networkd_cmd start
    ;;

    stop)
        networkd_cmd stop
    ;;

    restart|reload|force-reload)
        $0 stop
        $0 start
    ;;

    *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}"
        exit 2
esac

exit $?