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/50-yp.conf | |
| 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/50-yp.conf')
| -rw-r--r-- | dhcpcd-hooks/50-yp.conf | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/dhcpcd-hooks/50-yp.conf b/dhcpcd-hooks/50-yp.conf index 1b83d61d..4bdd0623 100644 --- a/dhcpcd-hooks/50-yp.conf +++ b/dhcpcd-hooks/50-yp.conf @@ -8,43 +8,43 @@ ypbind_pid() make_yp_conf() { - [ -z "${new_nis_domain}" -a -z "${new_nis_servers}" ] && return 0 - local cf=/etc/yp.conf."${interface}" prefix= x= pid= - rm -f "${cf}" - echo "${signature}" > "${cf}" - if [ -n "${new_nis_domain}" ]; then - domainname "${new_nis_domain}" - if [ -n "${new_nis_servers}" ]; then - prefix="domain ${new_nis_domain} server " + [ -z "$new_nis_domain" -a -z "$new_nis_servers" ] && return 0 + local cf=/etc/yp.conf."$interface" prefix= x= pid= + rm -f "$cf" + echo "$signature" > "$cf" + if [ -n "$new_nis_domain" ]; then + domainname "$new_nis_domain" + if [ -n "$new_nis_servers" ]; then + prefix="domain $new_nis_domain server " else - echo "domain ${new_nis_domain} broadcast" >> "${cf}" + echo "domain $new_nis_domain broadcast" >> "$cf" fi else prefix="ypserver " fi - for x in ${new_nis_servers}; do - echo "${prefix}${x}" >> "${cf}" + 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}" + cat "$cf" > /etc/yp.conf + rm -f "$cf" pid="$(ypbind_pid)" - if [ -n "${pid}" ]; then - kill -HUP "${pid}" + if [ -n "$pid" ]; then + kill -HUP "$pid" fi } restore_yp_conf() { - [ -n "${old_nis_domain}" ] && domainname "" + [ -n "$old_nis_domain" ] && domainname "" restore_conf /etc/yp.conf || return 0 local pid="$(ypbind_pid)" - if [ -n "${pid}" ]; then - kill -HUP "${pid}" + if [ -n "$pid" ]; then + kill -HUP "$pid" fi } -case "${reason}" in +case "$reason" in BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) make_yp_conf;; EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) restore_yp_conf;; esac |
