diff --git a/examples/dispatcher/10-ifcfg-rh-routes.sh b/examples/dispatcher/10-ifcfg-rh-routes.sh index d72400aed7..45dfc40147 100755 --- a/examples/dispatcher/10-ifcfg-rh-routes.sh +++ b/examples/dispatcher/10-ifcfg-rh-routes.sh @@ -12,6 +12,24 @@ # This file is derived from scripts 'if{up,down}-routes' from # Fedora/RHEL initscripts. +if [ "$2" != "pre-up" ] && [ "$2" != "down" ]; then + exit 0 +fi + +dir=$(dirname "$CONNECTION_FILENAME") +if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then + exit 0 +fi + +profile=$(basename "$CONNECTION_FILENAME" | sed -ne 's/^ifcfg-//p') +if [ -z "$profile" ]; then + exit 0 +fi + +if [ ! -f "$dir/rule-$profile" ] && [ ! -f "$dir/rule6-$profile" ]; then + exit 0 +fi + MATCH='^[[:space:]]*(\#.*)?$' handle_file () { @@ -45,24 +63,6 @@ handle_ip_file() { } -if [ "$2" != "pre-up" ] && [ "$2" != "down" ]; then - exit 0 -fi - -dir=$(dirname "$CONNECTION_FILENAME") -if [ "$dir" != "/etc/sysconfig/network-scripts" ]; then - exit 0 -fi - -profile=$(basename "$CONNECTION_FILENAME" | sed -ne 's/^ifcfg-//p') -if [ -z "$profile" ]; then - exit 0 -fi - -if [ ! -f "$dir/rule-$profile" ] && [ ! -f "$dir/rule6-$profile" ]; then - exit 0 -fi - case "$2" in pre-up) # Routes