summaryrefslogtreecommitdiff
path: root/conf/build-magic.sh
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-13 17:17:41 -0700
committerJared Adams <jaxad0127@gmail.com>2011-03-14 14:17:33 -0600
commit932d1724c9415701004a7efa3d31f63c60fcd2bc (patch)
tree5183137aca8aa6bbf07c1fbce1b5635fad0357c5 /conf/build-magic.sh
parent30b452fb6cec7c2cf83a33d58a74a6999d548a5c (diff)
downloadserverdata-932d1724c9415701004a7efa3d31f63c60fcd2bc.tar.gz
serverdata-932d1724c9415701004a7efa3d31f63c60fcd2bc.tar.bz2
serverdata-932d1724c9415701004a7efa3d31f63c60fcd2bc.tar.xz
serverdata-932d1724c9415701004a7efa3d31f63c60fcd2bc.zip
Simplify build-magic.sh code * Use /bin/sed directly instead of a /bin/bash script which only called sed * This change produces an incompatible spells-build file, and automatically deletes it.
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