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' echo 'Unable to build pleroma'
exit 268362 exit 268362
fi 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 fi
if [ -f /var/www/${domain_name}/htdocs/static/bg.jpg ]; then if [ -f $basedir/static/logo.png ]; then
cp /var/www/${domain_name}/htdocs/static/bg.jpg /var/www/${domain_name}/htdocs/static/bg.jpg.old cp $basedir/static/logo.png $basedir/static/logo.png.old
fi fi
if [ -f /var/www/${domain_name}/htdocs/static/config.json ]; then if [ -f $basedir/static/bg.jpg ]; then
cp /var/www/${domain_name}/htdocs/static/config.json /var/www/${domain_name}/htdocs/static/config.json.old cp $basedir/static/bg.jpg $basedir/static/bg.jpg.old
fi fi
cp -r $INSTALL_DIR/pleroma/dist/* /var/www/${domain_name}/htdocs/ if [ -f $basedir/static/config.json ]; then
if [ -f /var/www/${domain_name}/htdocs/static/config.json.old ]; then cp $basedir/static/config.json $basedir/static/config.json.old
mv /var/www/${domain_name}/htdocs/static/config.json.old /var/www/${domain_name}/htdocs/static/config.json
fi fi
sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" /var/www/${domain_name}/htdocs/static/config.json cp -r $INSTALL_DIR/pleroma/dist/* $basedir/
if [ -f /var/www/${domain_name}/htdocs/static/logo.png.old ]; then if [ -f $basedir/static/config.json.old ]; then
cp /var/www/${domain_name}/htdocs/static/logo.png.old /var/www/${domain_name}/htdocs/static/logo.png mv $basedir/static/config.json.old $basedir/static/config.json
fi fi
if [ -f /var/www/${domain_name}/htdocs/static/bg.jpg.old ]; then sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/static/config.json
cp /var/www/${domain_name}/htdocs/static/bg.jpg.old /var/www/${domain_name}/htdocs/static/bg.jpg 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 fi
if [ -f /var/www/${domain_name}/htdocs/index.php ]; then if [ -f $basedir/index.php ]; then
mv /var/www/${domain_name}/htdocs/index.php /var/www/${domain_name}/htdocs/index_qvitter.php mv $basedir/index.php $basedir/index_qvitter.php
fi fi
chown -R www-data:www-data /var/www/${domain_name}/htdocs chown -R www-data:www-data $basedir
else else
install_pleroma_front_end "${app_name}" "${domain_name}" "${background_url}" "${title}" install_pleroma_front_end "${app_name}" "${domain_name}" "${background_url}" "${title}"
fi fi