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

Side by Side Diff: dhcpcd-hooks/30-hostname

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/29-lookup-hostname ('k') | dhcpcd-hooks/50-dhcpcd-compat » ('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 # Set the hostname from DHCP data if required
2
3 need_hostname()
4 {
5 local hostname=""
6
7 case "$force_hostname" in
8 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) ;;
9 *) hostname="$(hostname)";;
10 esac
11 case "$hostname" in
12 ""|"(none)"|localhost|localhost.localdomain)
13 [ -n "$new_host_name" -o -n "$new_fqdn_name" ];;
14 "$old_host_name"|"$old_fqdn_name")
15 true;;
16 *)
17 false;;
18 esac
19 }
20
21 set_hostname()
22 {
23 if need_hostname; then
24 if [ -n "$new_host_name" ]; then
25 hostname "$new_host_name"
26 elif [ -n "$new_fqdn_name" ]; then
27 hostname "$new_fqdn_name"
28 fi
29 fi
30 }
31
32 case "$reason" in
33 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) set_hostname;;
34 esac
OLDNEW
« no previous file with comments | « dhcpcd-hooks/29-lookup-hostname ('k') | dhcpcd-hooks/50-dhcpcd-compat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698