Skip to content

Commit 197e233

Browse files
authored
Change Updatenotification (#2461)
1 parent c57ab7e commit 197e233

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

menu/main_menu.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ do_the_update() {
5757
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.
5858
To upgrade to the latest version, please run: 'sudo bash $SCRIPTS/update.sh' from your CLI."
5959
else
60-
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?"
60+
if version_gt "$NCVERSION" "$CURRENTVERSION"
6161
then
62-
# Check if it's an unsupported major version (will exit if it is)
63-
major_versions_unsupported
64-
# Do the upgrade if it's not
65-
bash "$SCRIPTS"/update.sh
62+
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?"
63+
then
64+
# Check if it's an unsupported major version (will exit if it is)
65+
major_versions_unsupported
66+
# Do the upgrade if it's not
67+
bash "$SCRIPTS"/update.sh
68+
fi
6669
fi
6770
fi
6871
fi

nextcloud_update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ if [ -f "$SCRIPTS"/updatenotification.sh ]
794794
then
795795
download_script STATIC updatenotification
796796
chmod +x "$SCRIPTS"/updatenotification.sh
797+
crontab -u root -l | grep -v "$SCRIPTS/updatenotification.sh" | crontab -u root -
798+
crontab -u root -l | { cat; echo "59 $AUT_UPDATES_TIME * * * $SCRIPTS/updatenotification.sh > /dev/null 2>&1"; } | crontab -u root -
797799
fi
798800

799801
############# Don't upgrade to specific version

static/updatenotification.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,26 @@ if [ "$NCVERSION" == "$NCMIN" ] && version_gt "$NCMIN" "$REPORTEDMIN" && version
5151
then
5252
sed -i "s|^REPORTEDMAJ.*|REPORTEDMAJ=$NCVERSION|" $SCRIPTS/updatenotification.sh
5353
sed -i "s|^REPORTEDMIN.*|REPORTEDMIN=$NCMIN|" $SCRIPTS/updatenotification.sh
54-
if crontab -l -u root | grep -q $SCRIPTS/update.sh
54+
if crontab -l -u root | grep -q $SCRIPTS/menu.sh
5555
then
5656
notify_admin_gui \
5757
"New minor Nextcloud Update!" \
5858
"Nextcloud $NCMIN just became available. Since you are running Automatic \
59-
Updates on Saturdays at $AUT_UPDATES_TIME:00, you don't need to bother about updating \
59+
Updates every month on Saturdays at $AUT_UPDATES_TIME:00, you don't need to bother about updating \
6060
the server to minor Nextcloud versions manually, as that's already taken care of."
6161
else
6262
notify_admin_gui \
6363
"New minor Nextcloud Update!" \
6464
"Nextcloud $NCMIN just became available. Please run 'sudo bash \
65-
/var/scripts/update.sh minor' from your CLI to update your server to Nextcloud $NCMIN."
65+
/var/scripts/menu.sh' --> Update Nextcloud from your CLI to update your server to Nextcloud $NCMIN."
6666
fi
6767
exit
6868
fi
6969

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

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

0 commit comments

Comments
 (0)