-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_un-get.sh
More file actions
52 lines (46 loc) · 1.63 KB
/
update_un-get.sh
File metadata and controls
52 lines (46 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# Author: [Cpt. Chaz]
# Created: [03/07/25]
# Updated: [05/21/25] - v1.2
# Description: A simple Unraid script for updating the un-get packages. This script will update, upgrade, and clean un-gets packages.
# Place script in the Unraid User Scripts plugin and schedule according to user preference.
# Status: Tested
#
# Credits:
# - un-get was created by **ich777**. More information can be found at:
# https://github.com/ich777/un-get
# - big thank you to ich777 for all their work!
# - To install un-get on Unraid, paste the following into the Plugin tab manually:
# https://raw.githubusercontent.com/ich777/un-get/master/un-get.plg
# -Thanks to reddit user u/ceestars for this info
# - Also, check out https://github.com/shinji257/unraid_pkgs/tree/main for more unraid packages for un-get
#
# - This script was created with the help of ChatGPT, an OpenAI language model.
#
# This script updates, upgrades, and cleans up un-get packages
set -e # Exit on any error
# Ensure un-get is installed
if ! command -v un-get >/dev/null 2>&1; then
echo "Error: un-get is not installed. Aborting."
exit 1
fi
# Update package list
echo "Updating package list..."
un-get update
# Attempt normal upgrade first
echo "Upgrading packages..."
if ! un-get upgrade; then
echo "Upgrade failed, attempting forced recovery..."
un-get clean
un-get update
yes | un-get upgrade --force || {
echo "Automatic recovery with --force failed. Please check manually."
exit 1
}
fi
# Cleanup old packages
echo "Cleaning up old packages..."
un-get cleanup
# Notify success
echo "All un-get packages have been updated successfully!"