summaryrefslogtreecommitdiffstats
path: root/dhcpcd/genembedh
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpcd/genembedh')
-rwxr-xr-xdhcpcd/genembedh15
1 files changed, 15 insertions, 0 deletions
diff --git a/dhcpcd/genembedh b/dhcpcd/genembedh
new file mode 100755
index 00000000..a155cfae
--- /dev/null
+++ b/dhcpcd/genembedh
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+: ${TOOL_SED:=sed}
+: ${TOOL_GREP:=grep}
+: ${TOOL_WC:=wc}
+CONF=${1:-dhcpcd-definitions.conf}
+H=${2:-dhcpcd-embedded.h.in}
+
+INITDEFINES=$($TOOL_GREP "^define " $CONF | $TOOL_WC -l)
+INITDEFINE6S=$($TOOL_GREP "^define6 " $CONF | $TOOL_WC -l)
+$TOOL_SED \
+ -e "s/@INITDEFINES@/$INITDEFINES/" \
+ -e "s/@INITDEFINE6S@/$INITDEFINE6S/" \
+ $H