include $(top_srcdir)/vars.am
-dist_noinst_DATA =
+noinst_DATA =
###--------------------------------------------------------------------------
### Contributions.
## Glue for `userv-ipif'.
-dist_noinst_DATA += tripe-ipif ipif-peers
+noinst_DATA += tripe-ipif ipif-peers
+EXTRA_DIST += tripe-ipif.in ipif-peers.in
+CLEANFILES += tripe-ipif ipif-peers
+
+tripe-ipif: tripe-ipif.in Makefile
+ $(SUBST) $(srcdir)/tripe-ipif.in >$@.new $(SUBSTITUTIONS) && \
+ mv $@.new $@
+
+ipif-peers: ipif-peers.in Makefile
+ $(SUBST) $(srcdir)/ipif-peers.in >$@.new $(SUBSTITUTIONS) && \
+ mv $@.new $@
###----- That's all, folks --------------------------------------------------
set -e
quis=${0##*/}
-case ${TRIPEDIR+t} in
- t) ;;
- *) echo >&2 "$quis: \`TRIPEDIR' unset"; exit 1 ;;
-esac
+: ${TRIPEDIR=@configdir@}
## Trundle through the table.
while read name remote_ext local_int remote_int routes; do
set -e
quis=${0##*/}
+: ${TRIPEDIR=@configdir@}
+: ${logfile=@logfile@}
+: ${TRIPE_IPIF_LOG=${logfile%/*}/tripe-ipif.log}
## Parse the command line.
case $# in 1) ;; *) echo >&2 "Usage: $quis PEER"; exit 1 ;; esac
peer=$1
## Arrange for errors to go somewhere.
-case "${TRIPE_IPIF_LOG+t}" in t) exec 2>>"$TRIPE_IPIF_LOG" ;; esac
+exec 2>>"$TRIPE_IPIF_LOG"
now=$(date +"%Y-%m-%d %H:%M:%S")
echo >&2 "$now $quis[$$] running for peer \`$peer'"