Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: dhcpcd-hooks/50-yp.conf

Issue 2428004: Overhaul dhcpcd for chrome os use (Closed) Base URL: ssh://git@chromiumos-git//dhcpcd.git
Patch Set: purge hooks from configure to silence complaint Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dhcpcd-hooks/50-ntp.conf ('k') | dhcpcd-hooks/50-ypbind » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Sample dhcpcd hook for ypbind
2 # This script is only suitable for the Linux version.
3
4 ypbind_pid()
5 {
6 [ -s /var/run/ypbind.pid ] && cat /var/run/ypbind.pid
7 }
8
9 make_yp_conf()
10 {
11 [ -z "$new_nis_domain" -a -z "$new_nis_servers" ] && return 0
12 local cf=/etc/yp.conf."$interface" prefix= x= pid=
13 rm -f "$cf"
14 echo "$signature" > "$cf"
15 if [ -n "$new_nis_domain" ]; then
16 domainname "$new_nis_domain"
17 if [ -n "$new_nis_servers" ]; then
18 prefix="domain $new_nis_domain server "
19 else
20 echo "domain $new_nis_domain broadcast" >> "$cf"
21 fi
22 else
23 prefix="ypserver "
24 fi
25 for x in $new_nis_servers; do
26 echo "$prefix$x" >> "$cf"
27 done
28 save_conf /etc/yp.conf
29 cat "$cf" > /etc/yp.conf
30 rm -f "$cf"
31 pid="$(ypbind_pid)"
32 if [ -n "$pid" ]; then
33 kill -HUP "$pid"
34 fi
35 }
36
37 restore_yp_conf()
38 {
39 [ -n "$old_nis_domain" ] && domainname ""
40 restore_conf /etc/yp.conf || return 0
41 local pid="$(ypbind_pid)"
42 if [ -n "$pid" ]; then
43 kill -HUP "$pid"
44 fi
45 }
46
47 case "$reason" in
48 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) make_yp_conf;;
49 EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) restore_yp_conf;;
50 esac
OLDNEW
« no previous file with comments | « dhcpcd-hooks/50-ntp.conf ('k') | dhcpcd-hooks/50-ypbind » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698