LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Update Script

[ILUG] Update Script

Andrew Court syklops at gmail.com
Wed Jun 10 11:50:31 IST 2009


This is very quick and dirty and not at all elegant, but it will give you an
idea of what you are looking for. I would also suggest reading a couple of
books on Linux and Shell scripting as the two go hand in hand.

Here is the script:

#!/bin/bash

NUM_OF_PKGS=`apt-get -V upgrade | wc -l`
SOUND_1=/home/someyoungguy/noupdates.wav
SOUND_2=/home/someyoungguy/WootUpdates.wav
SOUND_3=/home/someyoungguy/IRockUpgradeComplete.wav

if [$NUM_OF_PKGS == 0]
then
echo "There are no new updates" && mplayer $SOUND_2;

else {
$NUM_OF_PKGS [!= 0]
echo "There are $NUM_OF_PKGS available"
mplayer $SOUND_2

apt-get -V upgrade && mplayer SOUND_3
}
fi


What this does is it checks to see how many updates there are and counts
them, and plays a sound. If there are updates, then it tells you that, plays
another sound and then starts downloading the updates. WHen finished it
plays the third sound.

I would strongly recommend reading up on bash a bit. It is very powerful.
Just google for bash tutorial.





On Tue, Jun 9, 2009 at 5:08 AM, Steven Kavanagh <mrvestek at gmail.com> wrote:

> Ok simple one this, for the Ubuntu head's mostly (my app to Ubuntu list is
> still pending for some reason).
>
> Anyway was wondering if any of you gurus could help me with something quite
> simple. I'm working on an Lcars Ubuntu theme / login / splash and sound
> package and was wondering is there any way to write a script that would
> play
> soundexample.wav when Ubuntu prompts me that there are updates available
> and
> then play soundexample2.wav when updates are downloading then finally
> soundexample3.wav when the updates are finished installing?
>
> Cheers in advance for the help, should be simple enough but I'm no
> programmer :P
>
> Regards,
> Steve
> --
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/
>



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell