Mercurial > hg > dhcpcd
annotate hooks/30-hostname.in @ 5535:a0d828e25482 draft
Add --noconfigure option
With this set dhcpcd will not configure anything on the host.
The expectation is that a 3rd party script will instead.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Wed, 04 Nov 2020 14:18:48 +0000 |
| parents | b1808edeb35d |
| children |
| rev | line source |
|---|---|
|
5102
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
1 # Set the hostname from DHCP data if required |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
2 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
3 # A hostname can either be a short hostname or a FQDN. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
4 # hostname_fqdn=true |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
5 # hostname_fqdn=false |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
6 # hostname_fqdn=server |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
7 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
8 # A value of server means just what the server says, don't manipulate it. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
9 # This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
10 # where the DHCPv4 hostname is short and the DHCPv6 has an FQDN. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
11 # DHCPv6 has no hostname option. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
12 # RFC4702 section 3.1 says FQDN should be prefered over hostname. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
13 # |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
14 # As such, the default is hostname_fqdn=true so that a consistent hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
15 # is always assigned. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
16 : ${hostname_fqdn:=true} |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
17 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
18 # If we used to set the hostname, but relinquish control of it, we should |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
19 # reset to the default value. |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
20 : ${hostname_default=@DEFAULT_HOSTNAME@} |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
21 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
22 # Some systems don't have hostname(1) |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
23 _hostname() |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
24 { |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
25 if [ -z "${1+x}" ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
26 if [ -r /proc/sys/kernel/hostname ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
27 read name </proc/sys/kernel/hostname && echo "$name" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
28 elif type hostname >/dev/null 2>/dev/null; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
29 hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
30 elif sysctl kern.hostname >/dev/null 2>&1; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
31 sysctl -n kern.hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
32 elif sysctl kernel.hostname >/dev/null 2>&1; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
33 sysctl -n kernel.hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
34 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
35 return 1 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
36 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
37 return $? |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
38 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
39 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
40 if [ -w /proc/sys/kernel/hostname ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
41 echo "$1" >/proc/sys/kernel/hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
42 elif [ -n "$1" ] && type hostname >/dev/null 2>&1; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
43 hostname "$1" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
44 elif sysctl kern.hostname >/dev/null 2>&1; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
45 sysctl -w "kern.hostname=$1" >/dev/null |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
46 elif sysctl kernel.hostname >/dev/null 2>&1; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
47 sysctl -w "kernel.hostname=$1" >/dev/null |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
48 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
49 # May fail to set a blank hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
50 hostname "$1" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
51 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
52 } |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
53 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
54 is_default_hostname() |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
55 { |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
56 case "$1" in |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
57 ""|"$hostname_default"|localhost|localhost.localdomain) |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
58 return 0;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
59 esac |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
60 return 1 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
61 } |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
62 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
63 need_hostname() |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
64 { |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
65 # Always load the hostname variable for future use |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
66 hostname="$(_hostname)" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
67 is_default_hostname "$hostname" && return 0 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
68 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
69 case "$force_hostname" in |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
70 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) return 0;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
71 esac |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
72 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
73 if [ -n "$old_fqdn" ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
74 if ${hfqdn} || ! ${hshort}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
75 [ "$hostname" = "$old_fqdn" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
76 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
77 [ "$hostname" = "${old_fqdn%%.*}" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
78 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
79 elif [ -n "$old_host_name" ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
80 if ${hfqdn}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
81 if [ -n "$old_domain_name" ] && |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
82 [ "$old_host_name" = "${old_host_name#*.}" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
83 then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
84 [ "$hostname" = \ |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
85 "$old_host_name.$old_domain_name" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
86 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
87 [ "$hostname" = "$old_host_name" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
88 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
89 elif ${hshort}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
90 [ "$hostname" = "${old_host_name%%.*}" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
91 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
92 [ "$hostname" = "$old_host_name" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
93 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
94 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
95 # No old hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
96 false |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
97 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
98 } |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
99 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
100 try_hostname() |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
101 { |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
102 [ "$hostname" = "$1" ] && return 0 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
103 if valid_domainname "$1"; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
104 syslog info "Setting hostname: $1" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
105 _hostname "$1" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
106 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
107 syslog err "Invalid hostname: $1" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
108 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
109 } |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
110 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
111 set_hostname() |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
112 { |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
113 hfqdn=false |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
114 hshort=false |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
115 case "$hostname_fqdn" in |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
116 [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) hfqdn=true;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
117 ""|[Ss][Ee][Rr][Vv][Ee][Rr]) ;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
118 *) hshort=true;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
119 esac |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
120 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
121 need_hostname || return |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
122 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
123 if [ -n "$new_fqdn" ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
124 if ${hfqdn} || ! ${hshort}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
125 try_hostname "$new_fqdn" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
126 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
127 try_hostname "${new_fqdn%%.*}" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
128 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
129 elif [ -n "$new_host_name" ]; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
130 if ${hfqdn}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
131 if [ -n "$new_domain_name" ] && |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
132 [ "$new_host_name" = "${new_host_name#*.}" ] |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
133 then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
134 try_hostname "$new_host_name.$new_domain_name" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
135 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
136 try_hostname "$new_host_name" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
137 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
138 elif ${hshort}; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
139 try_hostname "${new_host_name%%.*}" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
140 else |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
141 try_hostname "$new_host_name" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
142 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
143 elif ! is_default_hostname "$hostname"; then |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
144 try_hostname "$hostname_default" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
145 fi |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
146 } |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
147 |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
148 # For ease of use, map DHCP6 names onto our DHCP4 names |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
149 case "$reason" in |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
150 BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6) |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
151 new_fqdn="$new_dhcp6_fqdn" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
152 old_fqdn="$old_dhcp6_fqdn" |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
153 ;; |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
154 esac |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
155 |
| 5535 | 156 if $if_configured && $if_up && [ "$reason" != ROUTERADVERT ]; then |
|
5102
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
157 set_hostname |
|
bab0daa700eb
linux: the default hostname is (none)
Roy Marples <roy@marples.name>
parents:
diff
changeset
|
158 fi |
