Aren't you a little sick of typing each time lines for updating software?

i've made this little script to update all at once...


save this for eg as rc.updates in /etc/rc.d/...
then run it by typing: /etc/rc.d/rc.updates

any improvements/ideas are welcome

_______________ Copy from below this line _____________________

#!/bin/sh
#
# Avoid using root's TMPDIR
unset TMPDIR

nessus() {

echo ---------------------------------------------
echo Nessus Daemon
echo
KIND="Nessus Server"
echo Current Version:
echo
nessusd -v
echo -n $"Shutting down $KIND: "
test -f /opt/nessus/var/nessus/nessusd.pid && kill `cat /opt/nessus/var/nessus/nessusd.pid`
RETVAL=$?
sleep 4
if [ "$RETVAL" == "0" ]; then
rm -f /var/lock/subsys/nessusd
echo services stopped successfully
else
echo services were not running...
fi
echo
echo -n "Updating $KIND: "
/opt/nessus/sbin/nessus-update
echo $KIND updated successfully
echo -n $"Starting $KIND services: "
/opt/nessus/sbin/nessusd -D --ipv4-only
echo $KIND services started...
echo
echo ---------------------------------------------
}
nessusplugins() {

echo ---------------------------------------------
echo Nessus Plugins
echo
KIND="Nessus Server"
echo -n $"Shutting down $KIND: "
test -f /opt/nessus/var/nessus/nessusd.pid && kill `cat /opt/nessus/var/nessus/nessusd.pid`
RETVAL=$?
sleep 4
if [ "$RETVAL" == "0" ]; then
rm -f /var/lock/subsys/nessusd
echo services stopped successfully
else
echo services were not running...
fi
echo
echo -n "Updating $KIND plugins: "
/opt/nessus/sbin/nessus-update-plugins -v
echo $KIND plugins updated successfully
echo -n $"Starting $KIND services: "
/opt/nessus/sbin/nessusd -D --ipv4-only
echo $KIND services started...
echo
echo ---------------------------------------------
}

nikto() {

echo ---------------------------------------------
echo Nikto
echo
KIND="Nikto"
echo -n "Updating $KIND plugins: "
nikto.pl -update
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

Amap() {

echo ---------------------------------------------
echo
echo Amap
echo
KIND="Amap"
echo Current version:
amap | grep amap | cut -d" " -f2,1 | tr ['Syntax: amap is /u r loc l b'] ' '
echo -n "Updating $KIND plugins: "
amap -W
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

aircrackng() {

echo ---------------------------------------------
echo Aircrack-NG
echo
KIND="Aircrack-NG"
echo Current version:
echo
aircrack-ng | grep Aircrack-ng | cut -d"T" -f0,1 | tr ['tom'] ' '
echo
echo -n "Updating $KIND: "
echo
cd /pentest/wireless/
update-aircrack.sh
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

Rkhunter() {

echo ---------------------------------------------
echo Rootkit Hunter
echo
KIND="Rootkit Hunter"
echo Current version:
echo
rkhunter | grep Rootkit | cut -d"C" -f1,0 | tr [','] ' '
echo
echo -n "Updating $KIND database: "
sh /usr/local/rkhunter/lib/rkhunter/scripts/check_update.sh /usr/local/etc/rkhunter.conf /usr/local/rkhunter/lib/rkhunter/db/mirrors.dat /usr/local/rkhunter/lib/rkhunter/db /usr/local/rkhunter/lib/rkhunter/db/md5blacklist.dat /var/log/rkhunter.log
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

metasploit2() {

echo ---------------------------------------------
echo Framework Metasploit 2
echo
KIND="Metasploit 2"
echo Current version:
echo
cd /pentest/exploits/framework2
msfconsole -v
msfcli -v
echo -n "Updating $KIND plugins: "
cd /pentest/exploits/framework2/
svn update
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

metasploit3() {

echo ---------------------------------------------
echo Framework Metasploit 3
echo
KIND="Metasploit 3"
echo Current version:
echo
cd /pentest/exploits/framework3
msfconsole -v
echo
echo -n "Updating $KIND plugins: "
cd /pentest/exploits/framework3/
svn update
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

milworm() {

echo ---------------------------------------------
echo Milw0rm Exploits
echo
KIND="Milworm exploits"
echo -n "Updating $KIND plugins: "
echo
cd /pentest/exploits/
update-milw0rm
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

pirana() {

echo ---------------------------------------------
echo Pirana Exploits "metasploit database"
echo
KIND="Pirana exploits"
echo Current version:
echo
cd /pentest/fuzzers/pirana/framework-2.5/
msfconsole -v
msfcli -v
echo -n "Updating $KIND: "
echo
svn update
echo $KIND plugins updated successfully
echo
echo ---------------------------------------------
}

all() {
nessus
nessusplugins
nikto
Amap
aircrackng
Rkhunter
metasploit2
metasploit3
milworm
pirana
}


case "$1" in
nessus)
nessus
;;
nessusplugins)
nessusplugins
;;
nikto)
nikto
;;
Amap)
Amap
;;
aircrackng)
aircrackng
;;
Rkhunter)
Rkhunter
;;
metasploit2)
metasploit2
;;
metasploit3)
metasploit3
;;
milworm)
milworm
;;
pirana)
pirana
;;
all)
all
;; *)
echo "Usage: rc.updates {nessus|nessusplugins|nikto|Amap|aircrackng|Rkhunt er|metasploit2|metasploit3|milworm|pirana|all)"
exit 1
esac
exit $?

______________________ END ______________________