#!/bin/sh # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Applying patches (if any) apply_patches ${1} && cd ${LFS_TMP}/${1} && install ddclient /usr/sbin && mkdir -p /etc/ddclient && cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf && cat > /var/lib/dhcpc/dhcpcd.exe << "EOF" && #!/bin/sh ## Update the DNS server unless the IP address is a private address ## that may be used as a internal LAN address. This may be true if ## other interfaces are assigned private addresses from internal ## DHCP server. # Arg #1: # Arg #2: # Arg #3: -d option source ${1} case "${IPADDR}" in 10.*) ;; 172.1[6-9].* | 172.2[0-9].* | 172.3[0-1].*) ;; 192.168.*) ;; *) case "${2}" in up) logger -t dhcpcd "IP address remaining at ${IPADDR}" ;; down) ;; new) logger -t dhcpcd "IP address changed to ${IPADDR}" && ddclient -daemon=0 -syslog -use=ip -ip=${IPADDR} >/dev/null 2>&1 ;; esac ;; esac exit $? EOF chmod 740 /var/lib/dhcpc/dhcpcd.exe # Return last error exit $?