summaryrefslogtreecommitdiff
path: root/replace.sh
blob: 0359b9b6c03835c34da2a5e69eb3241aad4a2b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

if [ -z $1 ] ; then
	echo missing argument: file to read
	exit 1
fi

file="$1"

sedargs=""
for var in \
	BINDIR \
	OPENRC_RUN \
	SYSCONFDIR \
	OPENRC_DIR \
	; do
	sedargs="${sedargs} -e s:\@${var}\@:${!var}:g "
done

cat "$file" | sed ${sedargs}