summaryrefslogtreecommitdiff
path: root/world/map/conf/build-magic.sh
blob: 30ec35b85319a8dedb805dc08418a02ff2546380 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash

RSCRIPT="spells-build"

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 -q $n $RSCRIPT; then
        CHANGES=1
        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 ./$RSCRIPT magic.conf.template > magic.conf;
fi