fi
}
-case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) add_resolv_conf;;
-PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) remove_resolv_conf;;
-esac
+if $if_up; then
+ add_resolv_conf
+elif $if_down; then
+ remove_resolv_conf
+fi
fi
}
-case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) set_hostname;;
-esac
+if $if_up; then
+ set_hostname
+fi
fi
}
-case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) set_hostname;;
-esac
+if $if_up; then
+ set_hostname
+fi
build_ntp_conf
}
-case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) add_ntp_conf add;;
-PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) remove_ntp_conf del;;
-esac
+if $if_up; then
+ add_ntp_conf add
+elif $if_down; then
+ remove_ntp_conf del
+fi
fi
}
-case "$reason" in
-BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) make_yp_conf;;
-EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) restore_yp_conf;;
-esac
+if $if_up; then
+ make_yp_conf
+elif $if_down; then
+ restore_yp_conf
+fi
signature_end="$signature_base_end $from $interface"
state_dir=/var/run/dhcpcd
+if_up=false
+if_down=false
+case "$reason" in
+BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) if_up=true;;
+PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) if_down=true;;
+esac
+
# Ensure that all arguments are unique
uniqify()
{