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

RSCRIPT="spells-build"

if [ -a $RSCRIPT ]; then printf ""; else
    echo '#! /bin/bash' > $RSCRIPT;
    echo 'sed \' >> $RSCRIPT;
    chmod a+x $RSCRIPT
fi

for n in `grep -o '"#..."' magic.conf.template`; do
    if grep $n $RSCRIPT; then printf ""; else
        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 cat magic.conf.template | ./$RSCRIPT > magic.conf;
fi