Dont you just hate it when ` apt-get upgrade ` changes your /etc/rc*.d's and starts daemons that you dont need running?
Here is a simple script to help by simply making a backup of your /etc/rc*.d directories and restoring them once the upgrade is finished.
system-upgrade.sh
Code:#!/bin/bash if [ $UID = "0" ]; then clear STATUS=0 echo "Please Wait:" echo -n "Updating Sources ...." apt-get -q update >/dev/null 2>&1 echo ".Done." echo -n "Backing up /etc/rc*.d ...." TEMP=/tmp/system-upgrade-$RANDOM mkdir $TEMP cp -a /etc/rc*.d $TEMP/. >/dev/null echo ".Done." echo "" echo "Performing Upgrade:" # Set STATUS= according to apt-gets exit status. # In place for later expansions apt-get -q upgrade && STATUS=0 || STATUS=1 # For now if STATUS=1 (Error) just exit without cleanup echo "" echo -n "Restoring /etc/rc*.d ..." rm -rfd /etc/rc*.d >/dev/null cp -a $TEMP/* /etc/. echo ".Done." [ $STATUS = 1 ] && exit 1 echo "" echo -n "Cleaning up ...." apt-get clean rm -rfd $TEMP echo ".Done." else echo "This script must be run as root!" fi
Here is another small script to simply update your sources and check if there are packages that can be upgraded.
checkup.sh
This script can be used in a cron if you null the output ( >/dev/null ) then evaluate /etc/apt/checkupgrades.status with something like:Code:#!/bin/bash if [ $UID = 0 ]; then echo "Checking for available upgrades...." apt-get update >/dev/null apt-get -s upgrade | grep Inst >/tmp/checkupgrades.out if [ -s /tmp/checkupgrades.out ]; then echo "" echo "... There are new updates for your system!" echo 1 >/etc/apt/checkupgrades.status rm -f /tmp/checkupgrades.out else echo "" echo "... There are no new updates for your system!" echo 0 >/etc/apt/checkupgrades.status rm -f /tmp/checkupgrades.out fi else echo "This script must be run as root!" fi
Code:CHECKUP_STATUS=$(cat /etc/apt/checkupgrades.status) if [ $CHECKUP_STATUS = 1 ]; then # There are upgrades else # No upgrades fi
Hoefully someone will find some of this usefull
Take Care,
-Justin
One Mynds Eye

Samsung 256GB SSD MZ-JPV256S/0A2 PCIe Solid State Drive SSD SSUBX 655-1959A
$22.02
Samsung T9 1TB External Portable SSD MU-PG1T0B -2000MB/s - Black
$179.00
Samsung Galaxy Tab S10+ 5G (256GB, 12GB, Wi-Fi + Cellular, Unlocked) 12.4" X828U
$579.99
SAMSUNG SF-760P Multifunction Laser Printer Copy/Fax/Print/Scan BRAND NEW IN BOX
$349.00
RAM-GDS-SKIN-SAM80-NG RAM IntelliSkin® Next Gen for Samsung Tab A7 Lite 8.7”
$82.99
3 -M.2 2280 512GB SSD - Samsung MZNTE512HMJH, MZNLN512HMJP, Toshiba KSG60ZMV512G
$155.00
1 lot of 3 (2)Samsung PM951 SM961 & (1)Intel SSD 600P 256GB M.2 2280 SSD NVMe
$109.00
RAM-GDS-DOCK-SAM80CPU RAM GDS® Tough-Dock™ for Samsung Tab A7 Lite 8.7"
$159.49
LOT OF 30 8GB 2Rx4 PC3L-10600R-9-11-E2 MT36KSF1G72PZ-1G4M1FF DDR3 Server RAM
$274.99
Samsung Galaxy Tab Active 3 / 64 gig/ WIFI/ IP68 Rated
$85.00