Verified Commit ba3bb5ea authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

insert envvars into config file

parent b3c2a5e6
#!/bin/bash
BASEDIR=/home/cantaloupe/app
# CONFIGPATH=
if [ ! -f "$BASEDIR/cantaloupe.properties" ]; then
CONFIGPATH="$BASEDIR/cantaloupe.properties.sample"
else
CONFIGPATH="$BASEDIR/cantaloupe.properties"
fi
while IFS= read -r line
do
if echo $line | grep -q "^[^#].\+"; then
KEY=`echo "$line" | cut -d"=" -f1`
ENVVAR=`echo $KEY | tr '[:lower:]' '[:upper:]' | sed -e 's/\./_/g'`
if [[ -v `echo $ENVVAR` ]]; then
echo "${KEY} = ${!ENVVAR}" >> $BASEDIR/temp.properties
else
echo "$line" >> $BASEDIR/temp.properties
fi
fi
done < $CONFIGPATH
mv $BASEDIR/temp.properties $BASEDIR/overridden.properties
echo "$BASEDIR/cantaloupe-${1}.war"
java -jar ${@:2} $BASEDIR/cantaloupe-${1}.war
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment