- check_ports # don't need to check ports if Discourse was already installed
- cp $template_path $config_file
+ check_ports
+ cp -v $web_template $web_file
+ if [ "$data_name" == "data" ]
+ then
+ echo "--------------------------------------------------"
+ echo "This multisite setup is currently unsupported. Use at your own risk!"
+ echo "--------------------------------------------------"
+ DISCOURSE_DB_PASSWORD=`date +%s | sha256sum | base64 | head -c 20`
+
+ sed -i -e "s/DISCOURSE_DB_PASSWORD: SOME_SECRET/DISCOURSE_DB_PASSWORD: $DISCOURSE_DB_PASSWORD/w $changelog" $web_file
+ if [ -s $changelog ]
+ then
+ rm $changelog
+ else
+ echo "Problem changing DISCOURSE_DB_PASSWORD" in $web_file
+ fi
+
+ cp -v $data_template $data_file
+ quote=\'
+ sed -i -e "s/password ${quote}SOME_SECRET${quote}/password '$DISCOURSE_DB_PASSWORD'/w $changelog" $data_file
+ if [ -s $changelog ]
+ then
+ rm $changelog
+ else
+ echo "Problem changing DISCOURSE_DB_PASSWORD" in $data_file
+ fi
+ fi