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

Commodore Amiga 500 Vintage Computer A500 No Power Supply
$249.95
Pi1541 Zero with Epyx Fastload Hat, Case & 16gb SD for Commodore 64 and 128
$79.99
PAL Commodore Amiga 2000 Vintage Computer Works Dual 3.5" NICE READ
$529.00
Commodore Amiga 600 Computer w/ PIStorm Framethrower Recapped, Caffeine OS NTSC
$799.99
COMMODORE AMIGA 500 WITH GOTEK NTSC,NO PSU ,NO MOUSE ,NO MONITOR ,TESTED
$355.00
Vtg Amiga Computer Monitor Commodore 13" Screen W/ Power Cord Powers On As Is
$279.95
Vintage Commodore Amiga A500 Computer with Power Supply & Tank Mouse - Untested
$400.00
Commodore Amiga 1000 Computer (WORKING) w/Keyboard +Extras
$700.00
OPEN BOX - AMIGA Genlock Interface Vintage Video Adapter 1300- GREAT
$329.95
External fully assembled GreaseWeazle 3.5 inch Floppy Drive
$135.00