Upgrade of pleroma front end handles pure pleroma install

This commit is contained in:
Bob Mottram 2017-11-07 10:12:23 +00:00
parent ea0af2d1e1
commit 10b3c5cff9
1 changed files with 22 additions and 17 deletions

View File

@ -389,31 +389,36 @@ function upgrade_pleroma_frontend {
echo 'Unable to build pleroma'
exit 268362
fi
if [ -f /var/www/${domain_name}/htdocs/static/logo.png ]; then
cp /var/www/${domain_name}/htdocs/static/logo.png /var/www/${domain_name}/htdocs/static/logo.png.old
basedir=/var/www/${domain_name}/htdocs
if [[ "$app_name" != 'pleroma' ]]; then
basedir=$PLEROMA_DIR/priv/static
fi
if [ -f /var/www/${domain_name}/htdocs/static/bg.jpg ]; then
cp /var/www/${domain_name}/htdocs/static/bg.jpg /var/www/${domain_name}/htdocs/static/bg.jpg.old
if [ -f $basedir/static/logo.png ]; then
cp $basedir/static/logo.png $basedir/static/logo.png.old
fi
if [ -f /var/www/${domain_name}/htdocs/static/config.json ]; then
cp /var/www/${domain_name}/htdocs/static/config.json /var/www/${domain_name}/htdocs/static/config.json.old
if [ -f $basedir/static/bg.jpg ]; then
cp $basedir/static/bg.jpg $basedir/static/bg.jpg.old
fi
cp -r $INSTALL_DIR/pleroma/dist/* /var/www/${domain_name}/htdocs/
if [ -f /var/www/${domain_name}/htdocs/static/config.json.old ]; then
mv /var/www/${domain_name}/htdocs/static/config.json.old /var/www/${domain_name}/htdocs/static/config.json
if [ -f $basedir/static/config.json ]; then
cp $basedir/static/config.json $basedir/static/config.json.old
fi
sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" /var/www/${domain_name}/htdocs/static/config.json
if [ -f /var/www/${domain_name}/htdocs/static/logo.png.old ]; then
cp /var/www/${domain_name}/htdocs/static/logo.png.old /var/www/${domain_name}/htdocs/static/logo.png
cp -r $INSTALL_DIR/pleroma/dist/* $basedir/
if [ -f $basedir/static/config.json.old ]; then
mv $basedir/static/config.json.old $basedir/static/config.json
fi
if [ -f /var/www/${domain_name}/htdocs/static/bg.jpg.old ]; then
cp /var/www/${domain_name}/htdocs/static/bg.jpg.old /var/www/${domain_name}/htdocs/static/bg.jpg
sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/static/config.json
if [ -f $basedir/static/logo.png.old ]; then
cp $basedir/static/logo.png.old $basedir/static/logo.png
fi
if [ -f $basedir/static/bg.jpg.old ]; then
cp $basedir/static/bg.jpg.old $basedir/static/bg.jpg
fi
if [ -f /var/www/${domain_name}/htdocs/index.php ]; then
mv /var/www/${domain_name}/htdocs/index.php /var/www/${domain_name}/htdocs/index_qvitter.php
if [ -f $basedir/index.php ]; then
mv $basedir/index.php $basedir/index_qvitter.php
fi
chown -R www-data:www-data /var/www/${domain_name}/htdocs
chown -R www-data:www-data $basedir
else
install_pleroma_front_end "${app_name}" "${domain_name}" "${background_url}" "${title}"
fi