#!/bin/bash # # This is a NetworkManager dispatcher hook for petrified. This file should # be copied to /etc/NetworkManager/dispatcher.d/10-petrified and set to # mode 0755, permissions root:root # Arguments - see networkmanager(8) INTERFACE=$1 STATUS=$2 # Command to run PETCMD=/usr/bin/petrified # Run any time a network status has changed, basically; this could be # easily customized to use a particular config for an exact interface # using the '-c ' parameter. case "$STATUS" in up) ${PETCMD} ;; vpn-up) ${PETCMD} ;; down) ${PETCMD} ;; vpn-down) ${PETCMD} ;; dhcp4-change) ${PETCMD} ;; dhcp6-change) ${PETCMD} ;; esac