From: Roy Marples Date: Wed, 19 Mar 2014 16:51:57 +0000 (+0000) Subject: Work with FreeBSD ypbind as well. X-Git-Tag: v6.4.0~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b6595b14714fbc1d4ba96fd8afe8a82a6798720;p=thirdparty%2Fdhcpcd.git Work with FreeBSD ypbind as well. --- diff --git a/configure b/configure index 39e8128a..726b48e7 100755 --- a/configure +++ b/configure @@ -690,7 +690,7 @@ if [ "$MD5" = no ]; then echo "MD5_SRC= md5.c" >>$CONFIG_MK else echo "MD5_SRC=" >>$CONFIG_MK - echo "CPPFLAGS+= -DHAVE_MD5_H" >>$CONFIG_MK + echo "#define HAVE_MD5_H" >>$CONFIG_H [ -n "$MD5_LIB" ] && echo "LDADD+= $MD5_LIB" >>$CONFIG_MK fi @@ -784,48 +784,54 @@ if ! $HOOKSET; then echo "not found" fi - printf "Checking for ypind ... " + printf "Checking for ypbind ... " YPBIND=$(_which ypbind) if [ -n "$YPBIND" ]; then + YPHOOK="50-ypbind" if strings "$YPBIND" | $GREP -q yp\\.conf; then YPHOOK="50-yp.conf" + YPOS="Linux" elif strings "$YPBIND" | $GREP -q \\.ypservers; then - YPHOOK="50-ypbind" + YPOS="NetBSD" echo "YPDOMAIN_DIR= /var/yp" >>$CONFIG_MK echo "YPDOMAIN_SUFFIX=.ypservers" >>$CONFIG_MK elif strings "$YPBIND" | $GREP -q /etc/yp; then - YPHOOK="50-ypbind" + YPOS="OpenBSD" echo "YPDOMAIN_DIR= /etc/yp" >>$CONFIG_MK echo "YPDOMAIN_SUFFIX=" >>$CONFIG_MK - fi - if [ -n "$YPHOOK" ]; then - echo "$YPBIND ($YPHOOK)" - HOOKS="$HOOKS${HOOKS:+ }$YPHOOK" else - echo "unsupported version" + YPOS="FreeBSD" + echo "YPDOMAIN_DIR=" >>$CONFIG_MK + echo "YPDOMAIN_SUFFIX=" >>$CONFIG_MK fi + echo "$YPBIND ($YPHOOK${YPOS:+ }$YPOS)" + HOOKS="$HOOKS${HOOKS:+ }$YPHOOK" else echo "not found" fi fi -cd dhcpcd-hooks -for x in $HOOKSCRIPTS; do - printf "Finding hook $x ... " - for h in [0-9][0-9]"-$x" [0-9][0-9]"-$x.sh" [0-9][0-9]"-$x.conf"; do - [ -e "$h" ] && break +if cd dhcpcd-hooks; then + for x in $HOOKSCRIPTS; do + printf "Finding hook $x ... " + for h in [0-9][0-9]"-$x" \ + [0-9][0-9]"-$x.sh" \ + [0-9][0-9]"-$x.conf" + do + [ -e "$h" ] && break + done + if [ ! -e "$h" ]; then + echo "no" + else + echo "$h" + case " $HOOKS " in + *" $h "*) ;; + *) HOOKS="$HOOKS${HOOKS:+ }$h";; + esac + fi done - if [ ! -e "$h" ]; then - echo "no" - else - echo "$h" - case " $HOOKS " in - *" $h "*) ;; - *) HOOKS="$HOOKS${HOOKS:+ }$h";; - esac - fi -done -cd .. + cd .. +fi echo "HOOKSCRIPTS= $HOOKS" >>$CONFIG_MK # Define any RCSIDs for import into 3rd party systems diff --git a/dhcpcd-hooks/50-ypbind.in b/dhcpcd-hooks/50-ypbind.in index c0ac104b..1421a169 100644 --- a/dhcpcd-hooks/50-ypbind.in +++ b/dhcpcd-hooks/50-ypbind.in @@ -1,5 +1,5 @@ # Sample dhcpcd hook for ypbind -# This script is only suitable for the NetBSD and OpenBSD versions. +# This script is only suitable for the BSD versions. : ${ypbind_restart_cmd:=service_command ypbind restart} : ${ypbind_stop_cmd:=service_condcommand ypbind stop}