summaryrefslogtreecommitdiff
path: root/conf/build-magic.sh
diff options
context:
space:
mode:
Diffstat (limited to 'conf/build-magic.sh')
-rwxr-xr-xconf/build-magic.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/conf/build-magic.sh b/conf/build-magic.sh
index f064a286..30ec35b8 100755
--- a/conf/build-magic.sh
+++ b/conf/build-magic.sh
@@ -2,20 +2,19 @@
RSCRIPT="spells-build"
-if [ -a $RSCRIPT ]; then printf ""; else
- echo '#! /bin/bash' > $RSCRIPT;
- echo 'sed \' >> $RSCRIPT;
+if ! grep -q -s '/bin/sed' $RSCRIPT; then
+ echo '#! /bin/sed -f' > $RSCRIPT;
chmod a+x $RSCRIPT
fi
for n in `grep -o '"#..."' magic.conf.template`; do
- if grep $n $RSCRIPT; then printf ""; else
+ if ! grep -q $n $RSCRIPT; then
CHANGES=1
- echo "'s/${n}/${n}/;'\\" >> $RSCRIPT;
+ echo "s/${n}/${n}/" >> $RSCRIPT;
fi
done
if [ x$CHANGES == x1 ]
then echo "${RSCRIPT} has been updated; please provide invocations for spells and/or teleport anchors.";
-else cat magic.conf.template | ./$RSCRIPT > magic.conf;
+else ./$RSCRIPT magic.conf.template > magic.conf;
fi