summaryrefslogblamecommitdiff
path: root/world/map/conf/build-magic.sh
blob: 77337df7330361baaf860889b9b76b18ff134e23 (plain) (tree)
1
2
3
4
5
6
7
8
            
 
                        

                      
 

                                         


                      
                                      
                                  
                                                           
                                        


      
                           
#! /bin/bash

OUTPUT=magic-secrets.sex
INPUT=$OUTPUT.template
RSCRIPT=secrets-build

if ! grep -q -s '/bin/sed' $RSCRIPT; then
    echo '#! /bin/sed -f' > $RSCRIPT;
    chmod a+x $RSCRIPT
fi

for n in `grep -o '"#..."' $INPUT`; do
    if ! grep -q $n $RSCRIPT; then
        echo "New secret ${n} needs to be set in $RSCRIPT!"
        echo "s/${n}/${n}/" >> $RSCRIPT;
    fi
done

./$RSCRIPT $INPUT > $OUTPUT