update_nextcloud.sh: support nginx webserver.
This commit is contained in:
parent
2cf20e4294
commit
9e38b08a0e
@ -382,6 +382,14 @@ if [[ "$DATABASE_TYPE" = "postgres" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if NGINX webserver is ctive
|
||||||
|
#
|
||||||
|
if $(systemctl -q is-active nginx) ; then
|
||||||
|
NGINX_IS_ACTIVE=true
|
||||||
|
else
|
||||||
|
NGINX_IS_ACTIVE=false
|
||||||
|
fi
|
||||||
|
|
||||||
# Check PHP Version
|
# Check PHP Version
|
||||||
#
|
#
|
||||||
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
|
if [[ "$PHP_ENGINE" = "FPM" ]] ; then
|
||||||
@ -623,6 +631,7 @@ fi
|
|||||||
# -
|
# -
|
||||||
echo ""
|
echo ""
|
||||||
echononl " Stop Apache Webserver.."
|
echononl " Stop Apache Webserver.."
|
||||||
|
if $IS_HTTPD_RUNNING ; then
|
||||||
if $SYSTEMD_EXISTS ; then
|
if $SYSTEMD_EXISTS ; then
|
||||||
systemctl stop apache2
|
systemctl stop apache2
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
@ -640,6 +649,35 @@ else
|
|||||||
fatal "$(cat $log_file)"
|
fatal "$(cat $log_file)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo_skipped
|
||||||
|
fi
|
||||||
|
|
||||||
|
# - Stop Nginx Webservice
|
||||||
|
# -
|
||||||
|
echo ""
|
||||||
|
echononl " Stop Nginx Webserver.."
|
||||||
|
if $NGINX_IS_ACTIVE ; then
|
||||||
|
if $SYSTEMD_EXISTS ; then
|
||||||
|
systemctl stop apache2
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo_ok
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
fatal "$(cat $log_file)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
/etc/init.d/apache2 stop
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo_ok
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
fatal "$(cat $log_file)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo_skipped
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@ -1331,6 +1369,53 @@ else
|
|||||||
warn "The webserver was not running, so it will be keept down!"
|
warn "The webserver was not running, so it will be keept down!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# - Start NGINX Webservise
|
||||||
|
# -
|
||||||
|
echo ""
|
||||||
|
echononl " Start Nginx Webserver.."
|
||||||
|
if $NGINX_IS_ACTIVE ; then
|
||||||
|
if $SYSTEMD_EXISTS ; then
|
||||||
|
systemctl start nginx > $log_file 2>&1
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo_ok
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
error "$(cat $log_file)"
|
||||||
|
|
||||||
|
echononl "continue anyway [yes/no]: "
|
||||||
|
read OK
|
||||||
|
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||||
|
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||||
|
echononl "Wrong entry! - repeat [yes/no]: "
|
||||||
|
read OK
|
||||||
|
done
|
||||||
|
[[ $OK = "yes" ]] || fatal "Interrupted by user."
|
||||||
|
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
/etc/init.d/nginx start > $log_file 2>&1
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo_ok
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
error "$(cat $log_file)"
|
||||||
|
|
||||||
|
echononl "continue anyway [yes/no]: "
|
||||||
|
read OK
|
||||||
|
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||||
|
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||||
|
echononl "Wrong entry! - repeat [yes/no]: "
|
||||||
|
read OK
|
||||||
|
done
|
||||||
|
[[ $OK = "yes" ]] || fatal "Interrupted by user."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo_skipped
|
||||||
|
warn "The NGINX is not configured as active - so nothing to do."
|
||||||
|
fi
|
||||||
|
|
||||||
_redis_cli_bin="$(which redis-cli)"
|
_redis_cli_bin="$(which redis-cli)"
|
||||||
if [[ -z "$_redis_cli_bin" ]]; then
|
if [[ -z "$_redis_cli_bin" ]]; then
|
||||||
if [[ -x "/usr/local/bin/redis-cli" ]]; then
|
if [[ -x "/usr/local/bin/redis-cli" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user