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


                         
 

                                         


                      
                                      
                                  
                                                           
                                        


      
                           
#! /bin/bash

OUTPUT=magic-secrets.conf
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