Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Updatenotification #2461

Merged
merged 12 commits into from
Apr 1, 2023
13 changes: 8 additions & 5 deletions menu/main_menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ do_the_update() {
msg_box "Since you have automated updates enabled with the reboot option set, we won't run update script a second time to the latest version automatically.
To upgrade to the latest version, please run: 'sudo bash $SCRIPTS/update.sh' from your CLI."
else
if yesno_box_yes "We will now run the update script a second time to update to the latest major version ($NCVERSION). Do you want to continue?"
if version_gt "$NCVERSION" "$CURRENTVERSION"
then
# Check if it's an unsupported major version (will exit if it is)
major_versions_unsupported
# Do the upgrade if it's not
bash "$SCRIPTS"/update.sh
if yesno_box_yes "We will now run the update script a second time to update to the latest major version ($NCVERSION). Do you want to continue?"
then
# Check if it's an unsupported major version (will exit if it is)
major_versions_unsupported
# Do the upgrade if it's not
bash "$SCRIPTS"/update.sh
fi
fi
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions nextcloud_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ if [ -f "$SCRIPTS"/updatenotification.sh ]
then
download_script STATIC updatenotification
chmod +x "$SCRIPTS"/updatenotification.sh
crontab -u root -l | grep -v "$SCRIPTS/updatenotification.sh" | crontab -u root -
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
crontab -u root -l | { cat; echo "59 $AUT_UPDATES_TIME * * * $SCRIPTS/updatenotification.sh > /dev/null 2>&1"; } | crontab -u root -
fi

############# Don't upgrade to specific version
Expand Down
12 changes: 6 additions & 6 deletions static/updatenotification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ if [ "$NCVERSION" == "$NCMIN" ] && version_gt "$NCMIN" "$REPORTEDMIN" && version
then
sed -i "s|^REPORTEDMAJ.*|REPORTEDMAJ=$NCVERSION|" $SCRIPTS/updatenotification.sh
sed -i "s|^REPORTEDMIN.*|REPORTEDMIN=$NCMIN|" $SCRIPTS/updatenotification.sh
if crontab -l -u root | grep -q $SCRIPTS/update.sh
if crontab -l -u root | grep -q $SCRIPTS/menu.sh
then
notify_admin_gui \
"New minor Nextcloud Update!" \
"Nextcloud $NCMIN just became available. Since you are running Automatic \
Updates on Saturdays at $AUT_UPDATES_TIME:00, you don't need to bother about updating \
Updates every month on Saturdays at $AUT_UPDATES_TIME:00, you don't need to bother about updating \
szaimen marked this conversation as resolved.
Show resolved Hide resolved
the server to minor Nextcloud versions manually, as that's already taken care of."
else
notify_admin_gui \
"New minor Nextcloud Update!" \
"Nextcloud $NCMIN just became available. Please run 'sudo bash \
/var/scripts/update.sh minor' from your CLI to update your server to Nextcloud $NCMIN."
/var/scripts/menu.sh' --> Update Nextcloud from your CLI to update your server to Nextcloud $NCMIN."
fi
exit
fi

if version_gt "$NCMIN" "$REPORTEDMIN" && version_gt "$NCMIN" "$CURRENTVERSION"
then
sed -i "s|^REPORTEDMIN.*|REPORTEDMIN=$NCMIN|" $SCRIPTS/updatenotification.sh
if crontab -l -u root | grep -q $SCRIPTS/update.sh
if crontab -l -u root | grep -q $SCRIPTS/menu.sh
then
notify_admin_gui \
"New minor Nextcloud Update!" \
Expand All @@ -81,7 +81,7 @@ the server to minor Nextcloud versions manually, as that's already taken care of
notify_admin_gui \
"New minor Nextcloud Update!" \
"Nextcloud $NCMIN just became available. Please run 'sudo bash \
/var/scripts/update.sh minor' from your CLI to update your server to Nextcloud $NCMIN."
/var/scripts/menu.sh' --> Update Nextcloud from your CLI to update your server to Nextcloud $NCMIN."
fi
fi

Expand All @@ -91,7 +91,7 @@ then
notify_admin_gui \
"New major Nextcloud Update!" \
"Nextcloud $NCVERSION just became available. Please run 'sudo bash \
/var/scripts/update.sh' from your CLI to update your server to Nextcloud $NCVERSION. \
/var/scripts/menu.sh' --> Update Nextcloud from your CLI to update your server to Nextcloud $NCVERSION. \
Before updating though, you should visit https://your-nc-domain/settings/admin/overview \
and make sure that all apps are compatible with the new version. And please never forget to \
create a backup and/or snapshot before updating!"
Expand Down