Stop ghost before updating
This commit is contained in:
parent
14afd04473
commit
da30734ba9
|
@ -46,6 +46,12 @@ ghost_variables=(GHOST_DOMAIN_NAME
|
||||||
DDNS_PROVIDER
|
DDNS_PROVIDER
|
||||||
MY_USERNAME)
|
MY_USERNAME)
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
function logging_on_ghost {
|
function logging_on_ghost {
|
||||||
echo -n ''
|
echo -n ''
|
||||||
}
|
}
|
||||||
|
@ -182,10 +188,14 @@ function upgrade_ghost {
|
||||||
if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then
|
if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl stop ghost
|
||||||
|
|
||||||
cd /var/www/$GHOST_DOMAIN_NAME/htdocs
|
cd /var/www/$GHOST_DOMAIN_NAME/htdocs
|
||||||
|
|
||||||
npm i -g ghost-cli
|
npm i -g ghost-cli
|
||||||
/usr/local/bin/ghost update
|
/usr/local/bin/ghost update
|
||||||
|
ghost_bust
|
||||||
|
|
||||||
ghost_replace_services
|
ghost_replace_services
|
||||||
ghost_remove_offsite_links
|
ghost_remove_offsite_links
|
||||||
|
@ -395,9 +405,7 @@ function install_ghost {
|
||||||
|
|
||||||
ghost install local --port ${GHOST_PORT}
|
ghost install local --port ${GHOST_PORT}
|
||||||
|
|
||||||
# kill the started ghost process
|
ghost_bust
|
||||||
kill_pid=$(ps aux | grep "ghost run" | awk -F ' ' '{print $2}' | head -n 1)
|
|
||||||
kill $kill_pid
|
|
||||||
|
|
||||||
# NOTE: this has to be http, not https
|
# NOTE: this has to be http, not https
|
||||||
sed -i "s|\"url\":|\"url\": \"http://${GHOST_DOMAIN_NAME}/\",|g" /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json
|
sed -i "s|\"url\":|\"url\": \"http://${GHOST_DOMAIN_NAME}/\",|g" /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json
|
||||||
|
|
Loading…
Reference in New Issue