This stops RA from stamping on NTP and YP configs.
build_resolv_conf()
{
- local cf="$state_dir/resolv.conf.$interface$if_suffix"
+ local cf="$state_dir/resolv.conf.$ifname"
local interfaces= header= search= srvs= servers= x=
# Build a list of interfaces
done
if type resolvconf >/dev/null 2>&1; then
[ -n "$ifmetric" ] && export IF_METRIC="$ifmetric"
- printf %s "$conf" | resolvconf -a "$interface$if_suffix"
+ printf %s "$conf" | resolvconf -a "$interface$ifname"
return $?
fi
- if [ -e "$resolv_conf_dir/$interface$if_suffix" ]; then
- rm -f "$resolv_conf_dir/$interface$if_suffix"
+ if [ -e "$resolv_conf_dir/$ifname" ]; then
+ rm -f "$resolv_conf_dir/$ifname"
fi
[ -d "$resolv_conf_dir" ] || mkdir -p "$resolv_conf_dir"
- printf %s "$conf" > "$resolv_conf_dir/$interface$if_suffix"
+ printf %s "$conf" > "$resolv_conf_dir/$ifname"
build_resolv_conf
}
remove_resolv_conf()
{
if type resolvconf >/dev/null 2>&1; then
- resolvconf -d "$interface$if_suffix" -f
+ resolvconf -d "$ifname" -f
else
- if [ -e "$resolv_conf_dir/$interface$if_suffix" ]; then
- rm -f "$resolv_conf_dir/$interface$if_suffix"
+ if [ -e "$resolv_conf_dir/$ifname" ]; then
+ rm -f "$resolv_conf_dir/$ifname"
fi
build_resolv_conf
fi
build_ntp_conf()
{
- local cf="$state_dir/ntp.conf.$interface"
+ local cf="$state_dir/ntp.conf.$ifname"
local interfaces= header= srvs= servers= x=
# Build a list of interfaces
add_ntp_conf()
{
- local cf="$ntp_conf_dir/$interface" x=
+ local cf="$ntp_conf_dir/$ifname" x=
[ -e "$cf" ] && rm "$cf"
[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
remove_ntp_conf()
{
- if [ -e "$ntp_conf_dir/$interface" ]; then
- rm "$ntp_conf_dir/$interface"
+ if [ -e "$ntp_conf_dir/$ifname" ]; then
+ rm "$ntp_conf_dir/$ifname"
fi
build_ntp_conf
}
make_yp_conf()
{
[ -z "$new_nis_domain" -a -z "$new_nis_servers" ] && return 0
- local cf=/etc/yp.conf."$interface" prefix= x= pid=
+ local cf=/etc/yp.conf."$ifname" prefix= x= pid=
rm -f "$cf"
echo "$signature" > "$cf"
if [ -n "$new_nis_domain" ]; then
make_yp_binding()
{
[ -d "$ypbind_dir" ] || mkdir -p "$ypbind_dir"
- echo "$new_nis_domain" >"$ypbind_dir/$interface"
+ echo "$new_nis_domain" >"$ypbind_dir/$ifname"
local nd="$(best_domain)"
local cf=/var/yp/binding/"$new_nis_domain".ypservers
if [ -n "$new_nis_servers" ]; then
- local ncf="$cf.$interface" x=
+ local ncf="$cf.$ifname" x=
rm -f "$ncf"
for x in $new_nis_servers; do
echo "$x" >>"$ncf"
restore_yp_binding()
{
- rm -f "$ypbind_dir/$interface"
+ rm -f "$ypbind_dir/$ifname"
local nd="$(best_domain)"
# We need to stop ypbind if there is no best domain
# otherwise it will just stall as we cannot set domainname
}
if [ "$reason" = PREINIT ]; then
- rm -f "$ypbind_dir/$interface"
+ rm -f "$ypbind_dir/$ifname"
elif $if_up || $if_down; then
if [ -n "$new_nis_domain" ]; then
if valid_domainname "$new_nis_domain"; then
# dhcpcd client configuration script
# Handy variables and functions for our hooks to use
+if [ "$reason" = ROUTERADVERT ]; then
+ ifsuffix=":ra"
+else
+ ifsuffix=
+fi
+ifname="$interface$ifsuffix"
+
from=from
signature_base="# Generated by dhcpcd"
-signature="$signature_base $from $interface"
+signature="$signature_base $from $ifname"
signature_base_end="# End of dhcpcd"
-signature_end="$signature_base_end $from $interface"
+signature_end="$signature_base_end $from $ifname"
state_dir=/var/run/dhcpcd
-if [ "$reason" = ROUTERADVERT ]; then
- if_suffix=":ra"
-else
- if_suffix=
-fi
-
# Ensure that all arguments are unique
uniqify()
{