1#!/bin/sh
2set -e
3
4: ${TOOL_SED:=sed}
5: ${TOOL_GREP:=grep}
6: ${TOOL_WC:=wc}
7CONF=${1:-dhcpcd-definitions.conf}
8H=${2:-dhcpcd-embedded.h.in}
9
10INITDEFINES=$($TOOL_GREP "^define " $CONF | $TOOL_WC -l)
11INITDEFINE6S=$($TOOL_GREP "^define6 " $CONF | $TOOL_WC -l)
12$TOOL_SED \
13	-e "s/@INITDEFINES@/$INITDEFINES/" \
14	-e "s/@INITDEFINE6S@/$INITDEFINE6S/" \
15	$H
16