# Work out if we need -lresolv or not
_LIBRESOLV_SH = printf '\#include <netinet/in.h>\n\#include <resolv.h>\nint main (void) { return (res_init ()); }\n' > .res_init.c; \
- if $(CC) .res_init.c -o .res_init >/dev/null 2>&1 ; then \
+ if $(CC) .res_init.c -o .res_init >/dev/null 2>&1; then \
echo ""; \
- elif $(CC) .res_init.c -lresolv -o .res_init >/dev/null 2>&1 ; then \
+ elif $(CC) .res_init.c -lresolv -o .res_init >/dev/null 2>&1; then \
echo "-lresolv"; \
else \
echo "Cannot work out how to get res_init to link" >&2; \
_LIBRT_SH = printf '\#include <time.h>\n\#include <unistd.h>\n\nint main (void) { struct timespec ts;\n\#if defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC)\nreturn (clock_gettime (CLOCK_MONOTONIC, &ts));\n\#else\nreturn -1;\n\#endif\n}\n' > .clock_gettime.c; \
if $(CC) .clock_gettime.c -o .clock_gettime >/dev/null 2>&1; then \
echo ""; \
- elif $(CC) .clock_gettime.c -lrt -o .clock_gettime >/dev/null 2>&1 ; then \
+ elif $(CC) .clock_gettime.c -lrt -o .clock_gettime >/dev/null 2>&1; then \
echo "-lrt"; \
else \
echo ""; \
# Sanity checks
if [ $# -lt 2 ]; then
- logger -s -p local0.err -t dhcpcd.sh "wrong usage"
- exit 1
+ logger -s -p local0.err -t dhcpcd.sh "wrong usage"
+ exit 1
fi
hostinfo="$1"
[ -e "${hostinfo}" ] && . "${hostinfo}"
case "${state}" in
- up)
- logger -s -p local0.info -t dhcpcd.sh \
- "interface ${INTERFACE} has been configured with old IP=${IPADDR}"
- # Put your code here for when the interface has been brought up with an
- # old IP address here
- ;;
+ up)
+ logger -s -p local0.info -t dhcpcd.sh \
+ "interface ${INTERFACE} has been configured with old IP=${IPADDR}"
+ # Put your code here for when the interface has been brought up with an
+ # old IP address here
+ ;;
- new)
- logger -s -p local0.info -t dhcpcd.sh \
- "interface ${INTERFACE} has been configured with new IP=${IPADDR}"
- # Put your code here for when the interface has been brought up with a
- # new IP address
- ;;
+ new)
+ logger -s -p local0.info -t dhcpcd.sh \
+ "interface ${INTERFACE} has been configured with new IP=${IPADDR}"
+ # Put your code here for when the interface has been brought up with a
+ # new IP address
+ ;;
- down) logger -s -p local0.info -t dhcpcd.sh \
- "interface ${INTERFACE} has been brought down"
- # Put your code here for the when the interface has been shut down
- ;;
+ down) logger -s -p local0.info -t dhcpcd.sh \
+ "interface ${INTERFACE} has been brought down"
+ # Put your code here for the when the interface has been shut down
+ ;;
esac
exit 0