diff --git a/lib.sh b/lib.sh index 3c402948..0ab15685 100644 --- a/lib.sh +++ b/lib.sh @@ -208,6 +208,14 @@ do done } +start_if_stopped() { +if ! pgrep "$1" +then + print_text_in_color "$ICyan" "Starting $1..." + check_command service "$1" start +fi +} + # Warn user that HTTP/2 will be disabled if installing app that use Apache2 PHP instead of PHP-FPM # E.g: http2_warn Modsecurity http2_warn() { diff --git a/nextcloud_update.sh b/nextcloud_update.sh index 9c4ed77f..ba1d9dd5 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -367,7 +367,7 @@ Please check in $BACKUP if the folders exist." fi # Start Apache2 -check_command service apache2 start +start_if_stopped apache2 # Recover apps that exists in the backed up apps folder run_static_script recover_apps