From 2dbc3d737c5ece0c60aa01397df3ba4fa60e1ae3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 14 Nov 2016 19:51:29 +0000 Subject: [PATCH] Replace and remove proprietary services from ghost blog --- src/freedombone-app-ghost | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/freedombone-app-ghost b/src/freedombone-app-ghost index 699b692e..e577779c 100755 --- a/src/freedombone-app-ghost +++ b/src/freedombone-app-ghost @@ -47,6 +47,33 @@ ghost_variables=(GHOST_VERSION DDNS_PROVIDER MY_USERNAME) +function ghost_replace_proprietary_services { + replace_file=$1 + + sed -i 's|Twitter Profile|GNU Social Profile|g' $replace_file + sed -i 's|Twitter Username|GNU Social Username|g' $replace_file + sed -i 's|twitter.com|quitter.se|g' $replace_file + sed -i 's|Facebook Page|Hubzilla Channel|g' $replace_file + sed -i 's|www.facebook.com/username|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/ghost|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/testuser|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/testing|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/test|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/yourUsername|hubzilladomain/username|g' $replace_file + sed -i 's|www.facebook.com/yourPage|hubzilladomain/username|g' $replace_file + sed -i 's|Facebook Username|Hubzilla Channel|g' $replace_file + sed -i 's|www.facebook.com|hubzilladomain|g' $replace_file + sed -i 's|facebook value|hubzilla value|g' $replace_file + + sed -i '/
/,/<\/section>/d' $replace_file +} + +function ghost_replace_services { + ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/core/built/assets/ghost.js + ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/core/built/assets/ghost.min.js + ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/content/themes/casper/post.hbs +} + function remove_user_ghost { remove_username="$1" } @@ -97,6 +124,14 @@ function reconfigure_ghost { function upgrade_ghost { read_config_param "GHOST_DOMAIN_NAME" + GHOST_PATH=/var/www/$GHOST_DOMAIN_NAME/htdocs + + function_check set_repo_commit + set_repo_commit $GHOST_PATH "ghost commit" "$GHOST_COMMIT" $GHOST_REPO + + ghost_replace_services + + systemctl restart ghost } function backup_local_ghost { @@ -424,6 +459,8 @@ function install_ghost { systemctl restart ghost fi + ghost_replace_services + function_check nginx_ensite nginx_ensite $GHOST_DOMAIN_NAME