File: ddclient.dhclient-exit-hook

package info (click to toggle)
ddclient 3.8.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,360 kB
  • sloc: perl: 16,297; sh: 643; xml: 55; makefile: 48
file content (20 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# /etc/dhcp/dhclient-exit-hooks.d/ddclient - exit hook for dhclient

# Run inside subshell so we can use exit to bail.

(
    [ -x /usr/sbin/ddclient ] || exit 0
    [ -f /etc/default/ddclient ] || exit 0
    . /etc/default/ddclient
    [ $run_dhclient = "true" ] || exit 0

    case $reason in
        BOUND | RENEW | REBIND)
            /usr/bin/logger -t dhclient $reason, updating IP address with ddclient
            /usr/sbin/ddclient -daemon=0 -syslog > /dev/null 2>&1
            ;;
        *)
            ;;
    esac
)