From cb887a3bb28d483a145e4e77642b4b497a208772 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 17 Sep 2017 21:45:24 +1200 Subject: Add script to macro-ify hardcoded values/paths --- replace.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 replace.sh diff --git a/replace.sh b/replace.sh new file mode 100755 index 0000000..5bde2bd --- /dev/null +++ b/replace.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ -z $1 ] ; then + echo missing argument: file to read + exit 1 +fi + +file="$1" + +sedargs="" +for var in \ + BINDIR \ + OPENRC_RUN \ + ; do + sedargs="${sedargs} -e s:\@${var}\@:${!var}:g " +done + +cat "$file" | sed ${sedargs} -- cgit v1.1