Also change pleroma background image in a separate static subdirectory

This commit is contained in:
Bob Mottram 2017-11-06 21:35:20 +00:00
parent 0b47e814e7
commit aa5feabc51
2 changed files with 15 additions and 0 deletions

View File

@ -309,6 +309,7 @@ function pleroma_set_title {
PLEROMA_DOMAIN_NAME=$(get_completion_param "pleroma domain") PLEROMA_DOMAIN_NAME=$(get_completion_param "pleroma domain")
write_config_param "PLEROMA_TITLE" "$PLEROMA_TITLE" write_config_param "PLEROMA_TITLE" "$PLEROMA_TITLE"
sed -i "s|\"name\":.*|\"name\": \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/static/config.json sed -i "s|\"name\":.*|\"name\": \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/static/config.json
sed -i "s|\"name\":.*|\"name\": \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/priv/static/static/config.json
sed -i "s|name: .*|name: \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/config/config.exs sed -i "s|name: .*|name: \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/config/config.exs
systemctl restart pleroma systemctl restart pleroma
dialog --title $"Set Pleroma title" \ dialog --title $"Set Pleroma title" \

View File

@ -133,6 +133,11 @@ function pleroma_set_background_image_from_url {
chown www-data:www-data static/bg_custom.${ext} chown www-data:www-data static/bg_custom.${ext}
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" static/config.json sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" static/config.json
fi fi
if [ -d priv/static/static ]; then
cp bg_custom.${ext} priv/static/static/bg_custom.${ext}
chown www-data:www-data priv/static/static/bg_custom.${ext}
sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" priv/static/static/config.json
fi
if [[ "$basedir" != $PLEROMA_DIR ]]; then if [[ "$basedir" != $PLEROMA_DIR ]]; then
qvitter_update_background ${domain_name} ${ext} qvitter_update_background ${domain_name} ${ext}
@ -148,9 +153,15 @@ function pleroma_set_background_image_from_url {
if [ -f $basedir/static/logo.png ]; then if [ -f $basedir/static/logo.png ]; then
if [ -f ~/freedombone/img/logo_fbone3.png ]; then if [ -f ~/freedombone/img/logo_fbone3.png ]; then
cp ~/freedombone/img/logo_fbone3.png $basedir/static/logo.png cp ~/freedombone/img/logo_fbone3.png $basedir/static/logo.png
if [ -d $basedir/priv/static/static ]; then
cp ~/freedombone/img/logo_fbone3.png $basedir/priv/static/static/logo.png
fi
else else
if [ -f /home/$MY_USERNAME/freedombone/img/logo_fbone3.png ]; then if [ -f /home/$MY_USERNAME/freedombone/img/logo_fbone3.png ]; then
cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/static/logo.png cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/static/logo.png
if [ -d $basedir/priv/static/static ]; then
cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/priv/static/static/logo.png
fi
fi fi
fi fi
fi fi
@ -159,6 +170,9 @@ function pleroma_set_background_image_from_url {
if [ -f $basedir/static/config.json ]; then if [ -f $basedir/static/config.json ]; then
sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/static/config.json sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/static/config.json
fi fi
if [ -f $basedir/priv/static/static/config.json ]; then
sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/priv/static/static/config.json
fi
echo "0" echo "0"
} }