mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
library.sh: Have notify_admin notify *all* admins, not just the first
1.51.0.sh: clear opcache after removing php-json, notify users if php8.2 packages need to be removed Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
92698aa028
commit
f09ccf26ce
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user