Explorar o código

Added check for configured Apache user and bumped version to 1.3

Michael Honkoop hai 2 meses
pai
achega
3ce20d08b1
Modificáronse 1 ficheiros con 13 adicións e 4 borrados
  1. 13 4
      localchecks/nextcloud-updates.sh

+ 13 - 4
localchecks/nextcloud-updates.sh

@@ -1,7 +1,9 @@
 #!/bin/bash
 
-# Version 1.2
+# Version 1.3
 #
+# v1.3 CHANGES:
+# - added check for configured apoache-user and basepath
 # v1.2 CHANGES:
 # - updated nextcloud release check to actually get latest version from the release-url
 # v1.1 CHANGES:
@@ -28,11 +30,18 @@ if [ $? -ne 0 ]; then
     exit;
 fi
 
+# check if configured apache user exists
+if ! id -u "$APACHEUSER" >/dev/null 2>&1; then
+    echo "2 \"NextCloud\" - NextCloud localcheck webserver user does not exist."
+    echo "2 \"NextCloud Apps\" - NextCloud localcheck webserver user does not exist."
+    exit;
+fi
+
 # check if configured basepath exists
 if [ ! -d "$BASEPATH" ]; then
-  echo "2 \"NextCloud\" - NextCloud localcheck could not find configured basepath"
-  echo "2 \"NextCloud Apps\" - NextCloud localcheck could not find configured basepath"
-  exit;
+    echo "2 \"NextCloud\" - NextCloud localcheck could not find configured basepath"
+    echo "2 \"NextCloud Apps\" - NextCloud localcheck could not find configured basepath"
+    exit;
 fi
 # Get current installed Nextcloud version-information
 # in v29.x.x version gives more detail, which is not given by the check on installed version, so switched to versionstring instead.