Skip to content

Commit b5491fa

Browse files
authored
Update update_un-get.sh to v1.1
update_un-get.sh v1.1 – add --force fallback on upgrade failure
1 parent a2ff97e commit b5491fa

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

update_un-get.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Author: [Cpt. Chaz]
44
# Created: [03/07/25]
5-
# Updated: [03/07/25]
5+
# Updated: [04/30/25] - v1.1
66
# Description: A simple Unraid script for updating the un-get packages. This script will update, upgrade, and clean un-gets packages.
77
# Place script in the Unraid User Scripts plugin and schedule according to user preference.
88
# Status: Tested
@@ -21,7 +21,7 @@
2121
# This script updates, upgrades, and cleans up un-get packages,
2222
# then notifies the Unraid GUI if everything runs smoothly.
2323

24-
set -e # Stop immediately on error
24+
set -e # Exit on any error
2525

2626
# Ensure un-get is installed
2727
if ! command -v un-get >/dev/null 2>&1; then
@@ -33,14 +33,14 @@ fi
3333
echo "Updating package list..."
3434
un-get update
3535

36-
# Upgrade packages
36+
# Attempt normal upgrade first
3737
echo "Upgrading packages..."
38-
if ! un-get upgrade --assume-yes; then # Remove --assume-yes if un-get doesn't support it
39-
echo "Upgrade failed, attempting recovery..."
38+
if ! un-get upgrade; then
39+
echo "Upgrade failed, attempting forced recovery..."
4040
un-get clean
4141
un-get update
42-
un-get upgrade --assume-yes || { # Remove --assume-yes if needed
43-
echo "Automatic recovery failed. Please check manually."
42+
un-get upgrade --force || {
43+
echo "Automatic recovery with --force failed. Please check manually."
4444
exit 1
4545
}
4646
fi
@@ -51,3 +51,4 @@ un-get cleanup
5151

5252
# Notify success
5353
echo "All un-get packages have been updated successfully!"
54+

0 commit comments

Comments
 (0)