rename notify function (#1040)
Signed-off-by: enoch85 <github@hanssonit.se>
This commit is contained in:
Родитель
79fcb309da
Коммит
e051e3240e
4
lib.sh
4
lib.sh
|
@ -1083,12 +1083,12 @@ esac
|
|||
}
|
||||
|
||||
# Example:
|
||||
# notify_user_gui \
|
||||
# notify_admin_gui \
|
||||
# "Subject" \
|
||||
# "Message"
|
||||
#
|
||||
# occ_command notification:generate -l "$2" "$admin" "$1"
|
||||
notify_user_gui() {
|
||||
notify_admin_gui() {
|
||||
CHECK_USERS=$(occ_command user:list | awk '{print $2}' | cut -d ":" -f1;)
|
||||
print_text_in_color "$ICyan" "Posting notification to users that are admins, this might take a while..."
|
||||
for admin in $CHECK_USERS
|
||||
|
|
|
@ -543,11 +543,11 @@ then
|
|||
fi
|
||||
clear
|
||||
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Please setup SMTP" \
|
||||
"Please remember to setup SMTP to be able to send shared links, user notifications and more via email. Please go here and start setting it up: https://your-nextcloud/settings/admin."
|
||||
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Do you need support?" \
|
||||
"If you need support, please visit the shop: https://shop.hanssonit.se, or the forum: https://help.nextcloud.com."
|
||||
|
||||
|
|
|
@ -627,7 +627,7 @@ Thank you for using T&M Hansson IT's updater!"
|
|||
occ_command status
|
||||
occ_command maintenance:mode --off
|
||||
print_text_in_color "$ICyan" "Sending notification about the successful update to all admins..."
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Nextcloud is now updated!" \
|
||||
"Your Nextcloud is updated to $CURRENTVERSION_after with the update script in the Nextcloud VM."
|
||||
echo "NEXTCLOUD UPDATE success-$(date +"%Y%m%d")" >> "$VMLOGS"/update.log
|
||||
|
@ -641,7 +641,7 @@ Your files are still backed up at $BACKUP. No worries!
|
|||
Please report this issue to $ISSUES
|
||||
|
||||
Maintenance mode is kept on."
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Nextcloud update failed!" \
|
||||
"Your Nextcloud update failed, please check the logs at $VMLOGS/update.log"
|
||||
occ_command status
|
||||
|
|
|
@ -23,7 +23,7 @@ then
|
|||
if [ "$(df -h $NCDATA | awk '{print $5}' | tail -1 | cut -d "%" -f1)" -gt 85 ]
|
||||
then
|
||||
# Notify user
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Disk space almost full!" \
|
||||
"The disk space for ncdata is almost full. We have automatically deleted ZFS snapshots older than 8 weeks and cleaned up your trashbin to free up some space and avoid a fatal crash. Please check $VMLOGS/zfs_prune.log for the results."
|
||||
# On screen information
|
||||
|
|
|
@ -23,11 +23,11 @@ if version_gt "$NCVERSION" "$CURRENTVERSION"
|
|||
then
|
||||
if crontab -l -u root | grep $SCRIPTS/update.sh
|
||||
then
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"New Nextcloud version!" \
|
||||
"Nextcloud $NCVERSION just became available. Since you are running Automatic Updates at $AUT_UPDATES_TIME:00, you don't need to bother about updating the server manually, as that's already taken care of."
|
||||
else
|
||||
notify_user_gui \
|
||||
notify_admin_gui \
|
||||
"Update availabile!" \
|
||||
"Nextcloud $NCVERSION is available. Please run 'sudo bash /var/scripts/update.sh' from your CLI to update your server."
|
||||
fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче