Fedora Linux Support Community & Resources Center
  #1  
Old 7th January 2005, 08:10 PM
ieuuk's Avatar
ieuuk Offline
Registered User
 
Join Date: Oct 2004
Location: uk
Age: 26
Posts: 705
little help with shell scripts please

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...
__________________
ieuuk :D

Registered Linux User: #373024
Reply With Quote
  #2  
Old 7th January 2005, 10:32 PM
rogue Offline
Registered User
 
Join Date: May 2004
Posts: 129
umm... time?

Incidentally, if you find that some of the program options (like formatting) aren't working it's because there are two time commands... the built in bash command and the one at /usr/bin/time.
Reply With Quote
  #3  
Old 7th January 2005, 10:37 PM
kama Offline
Registered User
 
Join Date: May 2004
Posts: 69
time yourscript.sh
see man time for more details
Reply With Quote
  #4  
Old 8th January 2005, 09:32 AM
ieuuk's Avatar
ieuuk Offline
Registered User
 
Join Date: Oct 2004
Location: uk
Age: 26
Posts: 705
Quote:
Originally Posted by rogue
umm... time?

Incidentally, if you find that some of the program options (like formatting) aren't working it's because there are two time commands... the built in bash command and the one at /usr/bin/time.
Quote:
Originally Posted by kama
time yourscript.sh
see man time for more details
Thanks for that people... thats a great help, for some reason i just couldnt find it anywhere
__________________
ieuuk :D

Registered Linux User: #373024
Reply With Quote
Reply

Tags
scripts, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell scripts newbie.. help sanjay_ankur Programming & Packaging 7 22nd June 2008 06:13 AM
Functions in shell scripts. Please help! GrahamB Programming & Packaging 8 18th April 2005 05:32 AM
Executing Shell Scripts DZack Using Fedora 3 9th March 2005 04:02 AM


Current GMT-time: 16:44 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat