fix: Switch to space-separated sources.conf format
- Change from colon to space separation to avoid URL parsing issues - Update sources.conf format: TYPE NAME URL VERSION BUILD_FUNCTION [EXTRA] - Implement awk-based parsing for reliable field extraction - Fix firmware package list (remove unavailable linux-firmware-marvell)
This commit is contained in:
59
initramfs/usr/share/dhcpcd/hooks/50-yp.conf
Normal file
59
initramfs/usr/share/dhcpcd/hooks/50-yp.conf
Normal file
@@ -0,0 +1,59 @@
|
||||
# Sample dhcpcd hook for ypbind
|
||||
# This script is only suitable for the Linux version.
|
||||
|
||||
ypbind_pid()
|
||||
{
|
||||
[ -s /var/run/ypbind.pid ] && cat /var/run/ypbind.pid
|
||||
}
|
||||
|
||||
make_yp_conf()
|
||||
{
|
||||
[ -z "${new_nis_domain}${new_nis_servers}" ] && return 0
|
||||
cf=/etc/yp.conf."$ifname"
|
||||
rm -f "$cf"
|
||||
echo "$signature" > "$cf"
|
||||
prefix=
|
||||
if [ -n "$new_nis_domain" ]; then
|
||||
if ! valid_domainname "$new_nis_domain"; then
|
||||
syslog err "Invalid NIS domain name: $new_nis_domain"
|
||||
rm -f "$cf"
|
||||
return 1
|
||||
fi
|
||||
domainname "$new_nis_domain"
|
||||
if [ -n "$new_nis_servers" ]; then
|
||||
prefix="domain $new_nis_domain server "
|
||||
else
|
||||
echo "domain $new_nis_domain broadcast" >> "$cf"
|
||||
fi
|
||||
else
|
||||
prefix="ypserver "
|
||||
fi
|
||||
for x in $new_nis_servers; do
|
||||
echo "$prefix$x" >> "$cf"
|
||||
done
|
||||
save_conf /etc/yp.conf
|
||||
cat "$cf" > /etc/yp.conf
|
||||
rm -f "$cf"
|
||||
pid="$(ypbind_pid)"
|
||||
if [ -n "$pid" ]; then
|
||||
kill -HUP "$pid"
|
||||
fi
|
||||
}
|
||||
|
||||
restore_yp_conf()
|
||||
{
|
||||
[ -n "$old_nis_domain" ] && domainname ""
|
||||
restore_conf /etc/yp.conf || return 0
|
||||
pid="$(ypbind_pid)"
|
||||
if [ -n "$pid" ]; then
|
||||
kill -HUP "$pid"
|
||||
fi
|
||||
}
|
||||
|
||||
if $if_configured; then
|
||||
if $if_up; then
|
||||
make_yp_conf
|
||||
elif $if_down; then
|
||||
restore_yp_conf
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user