LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-13-2007, 05:56 PM   #1
hraposo
Member
 
Registered: Aug 2004
Posts: 370

Rep: Reputation: 30
script return to menu


I made a script like this:

Code:
#!/bin/bash
# script.sh
#gnome-terminal
#xterm
eco ESCOLHA A OPÇÃO?
	echo "1 ) ACTUALIZAR SOURCE LIST."
	echo "2 ) INSTALAR PROGRAMAS."
	echo "3 ) CONFIGURAR O REDWRITE DOS DISCO ."
	echo "4 ) INSTALAR DRIVERS NVIDIA ."
	echo "5 ) SAIR ."
	echo -n "Select an Option: "
	read option
	case "$option" in
	1 ) 

echo ISTO VAI CONFIGURAR O REPOSITÓRIO!
wget http://192.168.1.4/apache/software/linux/gupsy/sources.list
mv /etc/apt/sources.list /etc/apt/sources.list_backtup
cp -r sources.list /etc/apt/sources.list
#echo "deb http://mirror3.ubuntulinux.nl/ edgy-seveas freenx" >> /etc/apt/sources.list 
#echo "deb http://www.agrassi.org/ubuntu feisty adunanza" >> /etc/apt/sources.list
#echo "deb-src http://www.agrassi.org/ubuntu feisty adunanza" >> /etc/apt/sources.list
echo "deb http://ftp.br.debian.org/debian/ etch main contrib non-free" >> /etc/apt/sources.list
echo "deb http://packages.freecontrib.org/ubuntu/plf edgy-plf free non-free" >> /etc/apt/sources.list
echo "deb-src http://packages.freecontrib.org/ubuntu/plf edgy-plf free non-free" >> /etc/apt/sources.list
rm -rf sources.list
echo FIM, DE ACTUALIZAÇÃO
		
		;;

		2 )
echo INSTALAR ALGUNS PROGRAMAS E CODECS
apt-get install clamav elisa realplayer bluefish restricted-manager freespeak alltray filezilla gftp opera amsn thunderbird pidgin liferea gthumb xchat acroread brasero gomebacker gtk-recordmydesktop soundconverter mplayer gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs w32codecs mplayer flashplayer-nonfree flashplugin-nonfree banshee sun-java6-jre sun-java6-fonts sun-java6-bin sun-java6-plugin sun-java6-jre sun-java6-fonts sun-java6-bin sun-java6-plugin gdesklets gdesklets-data 
wget http://www9.limewire.com/download/LimeWireLinux.deb
wget http://dl.google.com/linux/deb/pool/non-free/g/google-desktop-linux/google-desktop-linux_current_i386.deb
wget http://88.198.54.112/pub/getdeb/pd/pdfedit_0.3.1-1~getdeb1_i386.deb
wget http://web.telia.com/~u88005282/sum/archive/deb/startupmanager_1.0.2-2_all.deb
wget http://dl.google.com/linux/deb/pool/non-free/p/picasa/picasa_2.2.2820-5_i386.deb
dpkg -i picasa_2.2.2820-5_i386.deb
dpkg -i LimeWireLinux.deb
dpkg -i google-desktop-linux_current_i386.deb
dpkg -i pdfedit_0.3.1-1~getdeb1_i386.deb
dpk -i startupmanager_1.0.2-2_all.deb
rm -rf *.deb
echo FIM, DA INSTALAÇÃO

		;;
		3 )

echo AGORA CONFIGURAR O REDWRITE DOS DISCOS
#get all user interaction done right away
echo "deb http://givre.cabspace.com/ubuntu/ dapper main main-all" >> /etc/apt/sources.list
echo "deb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main main-all" >> /etc/apt/sources.list
echo "deb http://flomertens.keo.in/ubuntu/ dapper main main-all" >> /etc/apt/sources.list
apt-get install libfuse2 fuse-utils ntfs-3g
echo 'feito'
wget http://kent.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.1.tar.gz
tar zxvf fuse-2.6.1.tar.gz
cd fuse-2.6.1
./configure
make
make install
echo "fuse" >> /etc/modules
modprobe fuse
echo "/dev/hda5 /media/hda5 ntfs-3g defaults,silent,user,auto,umask=0,locale=pt_PT.utf8 0 0" >> /etc/fstab
echo "/dev/hda1 /media/hda1 ntfs-3g defaults,silent,user,auto,umask=0,locale=pt_PT.utf8 0 0" >> /etc/fstab
umount -a
mount -a
echo FIM,COMENTE AS ANTIGAS LINHAS DE HDA1 E HDA5 E FAÇA REBOOT

		;;
		
		4 )

echo VAMOS INSTALAR OS DRIVERS NVIDIA
wget http://albertomilone.com/ubuntu/nvidia/scripts/envy_0.9.7-0ubuntu6_all.deb			
dpkg -i envy_0.9.7-0ubuntu6_all.deb
apt-get install -f
rm -rf *.deb
envy -t
		;;

		5 )

exit 0
		;;
	esac

Now the one needed to know which the form commands that the menu of script comes back to appear when to finish an option.

Somebody can help?
 
Old 08-13-2007, 06:31 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How about wrapping it in 'select' ('help select' in bash)?
Code:
select option in quit choice0 choice1 choice2; do
 case $option in
  choice0) beep -r 10000000000000000
               ;;
  choice1) od -cN2 /dev/random|xargs 2>/dev/null
               ;;
  choice2) # mkfs.msdos -n imlovinit /dev/sda1
               ;;
  quit|*)     echo "Exiting loop."; break
               ;;
 esac
done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
return value of function in script ramesh_manu Red Hat 1 02-18-2007 01:05 PM
Return code of a shell script zachos.v Linux - Software 3 10-10-2006 09:51 AM
Return value to shell in script mwade Linux - Newbie 11 08-18-2006 09:49 AM
return to the install menu hraposo Debian 1 11-09-2004 03:52 AM
Is it possible to return variables from a script? pedrosan Linux - Newbie 6 04-20-2004 05:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration