dispatcher.d/11-dhclient000075500000002143147207315650011065 0ustar00#!/bin/bash # run dhclient.d scripts in an emulated environment PATH=/bin:/usr/bin:/sbin SAVEDIR=/var/lib/dhclient ETCDIR=/etc/dhcp interface=$1 eval "$( declare | LC_ALL=C grep '^DHCP4_[A-Z_]*=' | while read -r opt; do optname=${opt%%=*} optname=${optname,,} optname=new_${optname#dhcp4_} optvalue=${opt#*=} echo "export $optname=$optvalue" done )" [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network [ -f /etc/sysconfig/network-scripts/ifcfg-$interface ] && \ . /etc/sysconfig/network-scripts/ifcfg-$interface if [ -d $ETCDIR/dhclient.d ]; then for f in $ETCDIR/dhclient.d/*.sh; do if [ -x $f ]; then subsystem="${f%.sh}" subsystem="${subsystem##*/}" . ${f} if [ "$2" = "up" ]; then "${subsystem}_config" elif [ "$2" = "dhcp4-change" ]; then if [ "$subsystem" = "chrony" -o "$subsystem" = "ntp" ]; then "${subsystem}_config" fi elif [ "$2" = "down" ]; then "${subsystem}_restore" fi fi done fi dispatcher.d/cloud-init-azure-hook000075500000001317147207315650013207 0ustar00#!/bin/sh # This file is part of cloud-init. See LICENSE file for license information. # This script hooks into NetworkManager(8) via its scripts # arguments are 'interface-name' and 'action' # is_azure() { local dmi_path="/sys/class/dmi/id/board_vendor" vendor="" if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then [ "$vendor" = "Microsoft Corporation" ] && return 0 fi return 1 } is_enabled() { # only execute hooks if cloud-init is enabled and on azure [ -e /run/cloud-init/enabled ] || return 1 is_azure } if is_enabled; then case "$1:$2" in *:up) exec cloud-init dhclient-hook up "$1";; *:down) exec cloud-init dhclient-hook down "$1";; esac fi dispatcher.d/00-netreport000075500000000257147207315650011317 0ustar00#!/bin/sh cd /etc/sysconfig/network-scripts . ./network-functions [ -f ../network ] && . ../network # Notify programs that have requested notification do_netreport exit 0 dispatcher.d/20-chrony000075500000000654147207315650010602 0ustar00#!/bin/sh # This is a NetworkManager dispatcher / networkd-dispatcher script for # chronyd to set its NTP sources online or offline when a network interface # is configured or removed export LC_ALL=C # For NetworkManager consider only up/down events [ $# -ge 2 ] && [ "$2" != "up" ] && [ "$2" != "down" ] && exit 0 # Note: for networkd-dispatcher routable.d ~= on and off.d ~= off chronyc onoffline > /dev/null 2>&1 exit 0