#!/bin/sh
#*******************************************************************
#* Copyright Avaya Inc.                                             
#*******************************************************************

# This is the entry script, which iterates through the script folder
# calling each script in the order of their names. Any script(s) can
# be skipped from execution by providing its name to dhcpcd command
# line option of '--nohook <script-name>'. The <script-name> is then
# converted to a shell variable by dhcpcd and passed to this hook
# script as $skip_hooks


ROOT=$(cd `dirname $0` && pwd)
for hook in ${ROOT}/dhcpcd-hooks/*
do
        for skip in $skip_hooks; do
                case "$hook" in
                        */*~)                           continue 2;;
                        */"$skip")                      continue 2;;
                        */[0-9][0-9]"-$skip")           continue 2;;
                        */[0-9][0-9]"-$skip.sh")        continue 2;;
                esac
        done
        if [ -f "$hook" ]; then
                . "$hook"
        fi
done
