From 619834af05f1c059ed67eaa0bd18ef26a3490fb7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Aug 2017 18:12:00 +0100 Subject: [PATCH 1/2] Set ghost permissions after upgrade --- src/freedombone-app-ghost | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/freedombone-app-ghost b/src/freedombone-app-ghost index fe513353..b4647236 100755 --- a/src/freedombone-app-ghost +++ b/src/freedombone-app-ghost @@ -185,6 +185,8 @@ function reconfigure_ghost { } function upgrade_ghost { + read_config_param GHOST_DOMAIN_NAME + if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then return fi @@ -200,9 +202,8 @@ function upgrade_ghost { ghost_replace_services ghost_remove_offsite_links - if [ -f /usr/local/bin/ghost ]; then - chown root:root /usr/local/bin/ghost - fi + chown root:root /usr/local/bin/ghost + chown -R root:root /usr/local/lib chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs systemctl restart ghost } @@ -529,9 +530,8 @@ function install_ghost { function_check add_ddns_domain add_ddns_domain $GHOST_DOMAIN_NAME - if [ -f /usr/local/bin/ghost ]; then - chown root:root /usr/local/bin/ghost - fi + chown root:root /usr/local/bin/ghost + chown -R root:root /usr/local/lib chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs set_completion_param "ghost domain" "$GHOST_DOMAIN_NAME" if ! grep -q "ghost version:" ${COMPLETION_FILE}; then From 81295daf479a543acad98fda375707c959ccac54 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 16 Aug 2017 18:22:41 +0100 Subject: [PATCH 2/2] More ghost busting --- src/freedombone-app-ghost | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-ghost b/src/freedombone-app-ghost index b4647236..46c0a8fd 100755 --- a/src/freedombone-app-ghost +++ b/src/freedombone-app-ghost @@ -49,7 +49,10 @@ ghost_variables=(GHOST_DOMAIN_NAME function ghost_bust { # kill the started ghost process kill_pid=$(ps aux | grep "ghost run" | awk -F ' ' '{print $2}' | head -n 1) - kill $kill_pid + kill -9 $kill_pid + + kill_pid=$(ps aux | grep "ghost" | awk -F ' ' '{print $2}' | head -n 1) + kill -9 $kill_pid } function logging_on_ghost {