Replace and remove proprietary services from ghost blog

This commit is contained in:
Bob Mottram 2016-11-14 19:51:29 +00:00
parent 2e5ded585a
commit 2dbc3d737c
1 changed files with 37 additions and 0 deletions

View File

@ -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 class="share">/,/<\/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