Flush redis cache and restart redis server after nextcloud is updated.

This commit is contained in:
Christoph 2017-09-25 00:13:47 +02:00
parent 8bbcd0078c
commit b7b3fed445

View File

@ -655,7 +655,7 @@ fi
# -
echo ""
echo " Update Nextcloud"
su -c"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ upgrade" -s /bin/bash $HTTP_USER > $log_file 2>&1
su -c"/usr/local/php/bin/php ${WEB_BASE_DIR}/htdocs/occ upgrade" -s /bin/bash $HTTP_USER
if [[ $? -eq 0 ]]; then
echo_ok
else
@ -714,6 +714,47 @@ else
warn "The webserver was not running, so it will be keept down!"
fi
_redis_cli_bin="$(which redis-cli)"
if [[ -z "$_redis_cli_bin" ]]; then
if [[ -x "/usr/local/bin/redis-cli" ]]; then
_redis_cli_bin="/usr/local/bin/redis-cli"
fi
fi
echononl " Flush redis cache.."
if [[ -x "$_redis_cli_bin" ]]; then
$_redis_cli_bin flushall > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
echo_skipped
fi
echononl " Restart redis server.."
if $SYSTEMD_EXISTS ; then
systemctl restart redis-server > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
/etc/init.d/redis-server restart > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
fi
echononl " Install previously saved crontab from '$_backup_crontab_file'.."
crontab $_backup_crontab_file > $log_file 2>&1