diff options
| author | Roy Marples <roy@marples.name> | 2009-04-20 09:38:08 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-04-20 09:38:08 +0000 |
| commit | 4f06fdc0f91d4a1a5dcc16853bad22501bb3ce70 (patch) | |
| tree | bf0f4ec021bdf31630aeb07bffdd9ae9e1c7b4f0 /dhcpcd-hooks/29-lookup-hostname | |
| parent | e77f6a45143343565f3efe06487ccb18dd8dd071 (diff) | |
| download | dhcpcd-4f06fdc0f91d4a1a5dcc16853bad22501bb3ce70.tar.xz | |
Remove old NetworkManager script - it's useless these days.
Remove gratuitous usage of {} in variables.
Diffstat (limited to 'dhcpcd-hooks/29-lookup-hostname')
| -rw-r--r-- | dhcpcd-hooks/29-lookup-hostname | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/dhcpcd-hooks/29-lookup-hostname b/dhcpcd-hooks/29-lookup-hostname index 3214c50d..ce131225 100644 --- a/dhcpcd-hooks/29-lookup-hostname +++ b/dhcpcd-hooks/29-lookup-hostname @@ -2,19 +2,19 @@ lookup_hostname() { - [ -z "${new_ip_address}" ] && return 1 + [ -z "$new_ip_address" ] && return 1 local h= # Silly ISC programs love to send error text to stdout if type dig >/dev/null 2>&1; then - h=`dig +short -x ${new_ip_address}` + h=$(dig +short -x $new_ip_address) if [ $? = 0 ]; then - echo "${h}" | sed 's/\.$//' + echo "$h" | sed 's/\.$//' return 0 fi elif type host >/dev/null 2>&1; then - h=`host ${new_ip_address}` + h=$(host $new_ip_address) if [ $? = 0 ]; then - echo "${h}" \ + echo "$h" \ | sed 's/.* domain name pointer \(.*\)./\1/' return 0 fi @@ -24,11 +24,11 @@ lookup_hostname() set_hostname() { - if [ -z "${new_host_name}" -a -z "${new_fqdn_name}" ]; then + if [ -z "$new_host_name" -a -z "$new_fqdn_name" ]; then export new_host_name="$(lookup_hostname)" fi } -case "${reason}" in +case "$reason" in BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) set_hostname;; esac |
