diff --git a/etc/library.sh b/etc/library.sh index 46d5265d..4eab4c20 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -543,9 +543,12 @@ function notify_admin() { local header="$1" local msg="$2" - local admin=$(mysql -u root nextcloud -Nse "select uid from oc_group_user where gid='admin' limit 1;") - [[ "${admin}" == "" ]] && { echo "admin user not found" >&2; return 0; } - ncc notification:generate "${admin}" "${header}" -l "${msg}" || true + local admins=$(mysql -u root nextcloud -Nse "select uid from oc_group_user where gid='admin';") + [[ "${admins}" == "" ]] && { echo "admin user not found" >&2; return 0; } + while read -r admin + do + ncc notification:generate "${admin}" "${header}" -l "${msg}" || true + done <<<"$admins" } function save_maintenance_mode() diff --git a/updates/1.51.0.sh b/updates/1.51.0.sh index df137295..2a1bdf51 100644 --- a/updates/1.51.0.sh +++ b/updates/1.51.0.sh @@ -1,3 +1,18 @@ #!/bin/bash -apt-get remove -y php-json || true +set -e + +source /usr/local/etc/library.sh + +dpkg -l | grep -e '^ii' | grep -e 'php-json' > /dev/null && { + apt-get remove -y php-json + run_app "clear-php-opcache" +} + +dpkg -l | grep -e '^ii' | grep -e 'php8.2' > /dev/null && { + msg="PHP 8.2 packages have been detected on your ncp instance, which could cause issues. If you didn't install them on purpose, please remove them with the following command: sudo apt remove php8.2-*" + echo -e "$msg" + notify_admin "NextcloudPi" "$msg" +} + +exit 0