Keep track of ghost version
So that we're not upgrading every time
This commit is contained in:
parent
8c0afcc08e
commit
5db39cb66e
|
@ -34,6 +34,7 @@ VARIANTS="full full-vim writer"
|
|||
IN_DEFAULT_INSTALL=0
|
||||
SHOW_ON_ABOUT=1
|
||||
|
||||
GHOST_VERSION=1.0.2
|
||||
GHOST_DOMAIN_NAME=
|
||||
GHOST_CODE=
|
||||
GHOST_ONION_PORT=8104
|
||||
|
@ -53,6 +54,9 @@ function ghost_bust {
|
|||
|
||||
kill_pid=$(ps aux | grep "ghost" | awk -F ' ' '{print $2}' | head -n 1)
|
||||
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 {
|
||||
|
@ -188,6 +192,11 @@ function reconfigure_ghost {
|
|||
}
|
||||
|
||||
function upgrade_ghost {
|
||||
CURR_GHOST_VERSION=$(get_completion_param "ghost version")
|
||||
if [[ "${CURR_GHOST_VERSION}" == "${GHOST_VERSION}" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
read_config_param GHOST_DOMAIN_NAME
|
||||
|
||||
if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then
|
||||
|
@ -195,6 +204,7 @@ function upgrade_ghost {
|
|||
fi
|
||||
|
||||
systemctl stop ghost
|
||||
ghost_bust
|
||||
|
||||
cd /var/www/$GHOST_DOMAIN_NAME/htdocs
|
||||
|
||||
|
@ -209,6 +219,7 @@ function upgrade_ghost {
|
|||
chown -R root:root /usr/local/lib
|
||||
chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
|
||||
systemctl restart ghost
|
||||
sed -i "s|ghost version.*|ghost version:${GHOST_VERSION}|g" ${COMPLETION_FILE}
|
||||
}
|
||||
|
||||
function backup_local_ghost {
|
||||
|
|
Loading…
Reference in New Issue