hey. ive just started to play around a little with shell scripts in linux and just what i can do with them... if they can make my life any easier etc.
my first little project was to make configuring yum automatic... because i find it bit of a pain everytime i reinstall my fedora, so this is what i have already
Code:
#!/bin/sh
# Yum updater
#get yum config
echo "Yum Updater by Ian Richardson"
echo "last updated 22 December 2004"
echo ""
echo "download latest yum.conf"
wget http://www.fedorafaq.org/samples/yum.conf
echo ""
echo "installing yum.conf..."
cp yum.conf /etc/yum.conf
echo "...done"
echo ""
echo "deleting temp file..."
rm yum.conf
echo "...done"
echo ""
echo "importing gpg keys..."
echo "redhat..."
rpm --import /usr/share/doc/fedora-release-3/RPM-GPG-KEY*
echo "...done"
echo ""
echo "fedora.us..."
rpm --import http://www.fedora.us/FEDORA-GPG-KEY
echo "...done"
echo ""
echo "rpm.livna.com..."
rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY
echo "...done"
echo ""
echo "fresh rpm..."
rpm --import http://freshrpms.net/packages/RPM-GPG-KEY.txt
echo "...done"
echo ""
echo "dag..."
rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
echo "...done"
echo ""
echo "atrpms..."
rpm --import http://atrpms.net/RPM-GPG-KEY.atrpms
echo "...done"
echo ""
echo "newrpms..."
rpm --import http://newrpms.sunsite.dk/gpg-pubkey-newrpms.txt
echo "...done"
echo ""
echo "dries..."
rpm --import http://apt.sw.be/dries/RPM-GPG-KEY.dries.txt
echo "...done"
echo ""
echo "jpackage..."
rpm --import http://www.jpackage.org/jpackage.asc
echo "...done"
echo ""
#run yum to check for updates
echo "running yum (yum -y update)"
yum -y update
echo ""
echo "yum updater complete"
what i would like to add is a time which at the end says how long it took to run the whole thing if thats possiable. Ive been searching aroudn trying to find out how to do it somewhere but just havent got anywhere.
thanks in advance...