Chinaunix首页 | 论坛 | 博客
  • 博客访问: 658271
  • 博文数量: 780
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 4885
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-22 16:14
文章分类

全部博文(780)

文章存档

2008年(780)

我的朋友
F8

分类: LINUX

2008-08-22 16:20:39


下面是Fedora8的,Fedora7的见附件,哈哈,大家有兴趣的可以研究一下,锻炼自己的SHELL编程能力也不错
class=codetop>CODE:class=codemain>#!/bin/bash

#lastupdated29/10/0710amchangeddvdplaybackaddedgstreamer-plugins-all
#lastupdated29/10/078pmupdatedmadwifi9.3.2to9.3.3addedmodprobelivnarepotemp
#lastupdated30/10/074.45pmchangedpersonalandcorrectedmenudisplaynvidia
#lastupdated01/11/07addedrootcheckswappedmenusallowformore
#lastupdated03/11/07revertedmadwifibackto9.3.2otherbecomeunstablewithnewkernel.43
#lastupdated06/11/07updatedmplayercodecstolatestver20071007
#lastupdated08/11/07addedmorewebcamdrivers#xinechangedplparsernochangeneeded
#lastupdated16/11/07addedenableflashpluginsfor64bitfirefox
#lastupdated18/11/07addedautostartnetworkmanagerwheninstallingwirelessdrivers
#lastupdated18/11/07addedcompiz-fusiongnometestingonly
#lastupdated19/11/07addedsetupsudowithorwithoutpassword
#lastupdated24/11/07changedpersonal
#lastupdated05/12/07removeandchangedpersonal,removedjava,addedfglrx,
#lastupdated13/12/07dependencieschangedhadtoaddffmpegmanuallyremovedcompizfeverthingisinreposnowneedtoruncompizf
#lastupdated18/12/07putbacksunjava6u3changedpersonaladdedgoogledesktop/picasaconfigtouchpad/gysynaptics
#lastupdated20/12/07changedpersonaladdedweblider gnome-color-chooserhotbabe
#lastupdated23/12/07updatedfrostwiretolatestversion
#lastupdated24/12/07added--nogpgchecktognome-color-chooserwoopssorryall
#lastupdated24/12/07added--nogpgchecktognome-color-chooserwoopssorryall
#lastupdated26/12/07addedlightscribechangedpersonal
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
#lastupdated
if[$(whoami)="root"]
then
thunderbirdsarego
else
clear
echo""
echo"$(logname)Youmustloginthisterminalasrootsu-."
echo""
exit1
fi

typeset-rYUM="`whichyum`"
typeset-rRPM="`whichrpm`"
typeset-rPERL="`whichperl`"

DUMP_PATH="/temp"

WELCOME="1"

TOPL="-geometry96x25 0 0"
TOPR="-geometry96x25-0 0"

CHOICES="123456789"

functionmenu{
clear
echo-en"\033[0;40;32m"
clear
echoHello$(logname)
echo"#################################DANGERMOUSE#################################"
echo"###Whatwouldyouliketodo?###"
echo"###1)AdobeFlashPluginandAdoberepository###"
echo"###2)Driversallsorts(wireless,display,webcams,touchpad,etcplus###"
echo"###lightscribe.###"
echo"###3)Sudosetupwithorwithoutpassword###"
echo"###4)Sunjava6u3###"
echo"###5)GoogledesktoporPicaso###"
echo"###6)LimewireorFrostwireorRealPlayerGold10###"
echo"###7)Personal###"
echo"###8)Dvdplayback extracodecs/plugins###"
echo"###9)ExitsThisScript###"
echo"##################################DANGERMOUSE################################"
}

functiondvd{
$RPM-Uvh
$RPM-e--nodepstotem-plparser.x86_64totem-plparser.i386totemtotem-mozplugin
$YUM-yinstallyum-protectbase
$PERL-i-pe"s/(\[.*\])/\1\nprotect=yes/"/etc/yum.repos.d/{fedora*,livna*}
$YUM-yinstalltotem-xinetotem-xine-plparsertotem-xine-mozpluginmozpluggermplayerplug-inxmmsxmms-mp3xmms-faad2gstreamer-plugins-uglygstreamer-plugins-badlibmadlibid3taglibdvdcsslibdvdnavxine-lib-extras-nonfreexine-lib-extraslibquicktimevlcffmpeg
wgetwww1.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
tar-jxvfall-20071007.tar.bz2
mkdir-p/usr/local/lib/codecs
cpall-20071007/*/usr/local/lib/codecs
ln-sf/usr/local/lib/codecs/usr/lib/codecs&&ln-sf/usr/local/lib/codecs/usr/local/lib/win32&&ln-sf/usr/local/lib/codecs/usr/lib/win32
cd$DUMP_PATH
}

functionsetsudo{
whiletrue;do
clear
echo"###################################################################"
echo"###Setupcurrentuser(logname)withsudo(assudoer)###"
echo"######"
echo"###1)Withpassword###"
echo"###2)Nopassword###"
echo"###3)Backtomainmenu###"
echo"###################################################################"
readyn
case$ynin
1)sudopswd;break;;
2)sudonpswd;break;;
3)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}



functionsudonpswd{
echo"$(logname)ALL=(ALL)ALL">>/etc/sudoer
chmod w/etc/sudoers
echo"$(logname)ALL=(ALL)NOPASSWD:ALL">>/etc/sudoers
chmod-w/etc/sudoers
sleep5
cd$DUMP_PATH
}

functiongoogle{
whiletrue;do
clear
echo"###################################################################"
echo"###Setupcurrentuser(logname)withsudo(assudoer)###"
echo"######"
echo"###1)GoogleDesktop###"
echo"###2)GooglePicaso###"
echo"###3)Backtomainmenu###"
echo"###################################################################"
readyn
case$ynin
1)googled;break;;
2)googlep;break;;
3)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functiongoogled{
cat</etc/yum.repos.d/google.repo
[google]
name=Google-i386
baseurl=
enabled=1
gpgkey=
EOF
wget
$RPM--importlinux_signing_key.pub
$YUM-yinstallgoogle-desktop-linux.i586
cd$DUMP_PATH
}

functiongooglep{
cat</etc/yum.repos.d/google.repo
[google]
name=Google-i386
baseurl=
enabled=1
gpgkey=
EOF
wget
$RPM--importlinux_signing_key.pub
$YUM-yinstallpicasa.i386
cd$DUMP_PATH
}

functionsudopswd{
echo"$(logname)ALL=(ALL)ALL">>/etc/sudoer
chmod w/etc/sudoers
echo"$(logname)ALL=(ALL)PASSWD:ALL">>/etc/sudoers
chmod-w/etc/sudoers
sleep5
cd$DUMP_PATH
}


functionabode{
$RPM-Uvh
$YUM-yinstallflash-plugin.i386
mkdir-p/usr/lib/mozilla/plugins
$YUM-yinstallnspluginwrapper.{i386,x86_64}pulseaudio-libs.i386
mozilla-plugin-config-i-g-v
cd$DUMP_PATH
}

functionjava{
clear
$YUM-yinstallcompat-libstdc -33compat-libstdc -296
wget
shjre-6u3*.bin
ln-sf"$(rpm-qljre|grepplugin|grepns7/|grep\\.so$)"/usr/lib/mozilla/plugins/libjavaplugin_oji.so&/usr/sbin/alternatives--install/usr/bin/javajava$(rpm-qljre|grepbin/java$)2
xterm$TOPL-bg"#000000"-fg"#99CCFF"-title"CHOOSEYOURDEFAULTVERSION"-e/usr/sbin/alternatives--configjava
cd$DUMP_PATH
}


functionmadwifi{
rm-rf/lib/modules/$(uname-r)/kernel/drivers/net/wireless/ath5k;depmod
xterm$TOPL-bg"#000000"-fg"#99CCFF"-title"DOWNLOADINGANDINSTALLINGMADWIFI"-e"$YUM-yinstallgcckernel-devel-$(uname-r)&&wget"
/sbin/chkconfigNetworkManageron
/sbin/chkconfignetworkoff
cd$DUMP_PATH
}

functionwireless{
whiletrue;do
clear
echo"###################################################################"
echo"###Selectwhichwirelessdrivertoinstall###"
echo"######"
echo"###1)Broadcom43xxSEENOTEATBOTTOM###"
echo"###2)Madwifi/AtherosSEENOTEATBOTTOM###"
echo"###3)Backtomainmenu###"
echo"######"
echo"###NOTE###"
echo"###Networkmangerwillbeenabledbydefaultonboot###"
echo"###Pleaserestartafterdriverinstallation###"
echo"###Atheros/Madwifishouldalreadywork,theabovedriverwill###"
echo"###installastableversionfrommadwifiandbantheprein-###"
echo"###-installeddriver###"
echo"###################################################################"
readyn
case$ynin
1)broadcom;break;;
2)madwifi;break;;
3)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functionnvidiafx{
$RPM-Uvh
$YUM-yinstallyum-protectbase
$PERL-i-pe"s/(\[.*\])/\1\nprotect=yes/"/etc/yum.repos.d/{fedora*,livna*}
$YUM-yinstallkmod-nvidiaxorg-x11-drv-nvidia-libs-32bit
cd$DUMP_PATH
}

functionnvidiamx{
$RPM-Uvh
$YUM-yinstallyum-protectbase
$PERL-i-pe"s/(\[.*\])/\1\nprotect=yes/"/etc/yum.repos.d/{fedora*,livna*}
$YUM-yinstallkmod-nvidia-96xxxorg-x11-drv-nvidia-96xx-libs-32bit
cd$DUMP_PATH
}

functionpersonal{
whiletrue;do
clear
echo-e''\E[31;40m''
echo"####################################################################"
echo"###Thisisforpersonaluse,useatyourownrisk!!!!!###"
echo"######"
echo"###1)Repo''sLivna,abode,freshrpms,protectbase###"
echo"###2)Installmostprogramsiuse###"
echo"###3)gnome-color-chooser###"
echo"###4)Webliderwallpaperchanger###"
echo"###5)Hotbabecpudisplay(type[hot-babe]inaterminal###"
echo"###6)Exittomainmenu###"
echo"######"
echo"####################################################################"
readyn
case$ynin
1)repos;break;;
2)most;break;;
3)color;break;;
4)weblider;break;;
5)hotbabe;break;;
6)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functionhotbabe{
wget
$RPM-Uvhhot-babe-0.2.2-2.i386.rpm
cd$DUMP_PATH
}


functionweblider{
$YUM-yinstallpython-imaging
wget
tar-xvfWebilder-0.6.2.tar.gz
cdWebilder-0.6.2
pythonsetup.pyinstall
cd$DUMP_PATH
}

functioncolor{
wget
$YUM-ylocalinstall/temp/gnome-color-chooser-0.2.2-1.fc8.i386.rpm--nogpgcheck
cd$DUMP_PATH
}

functionrepos{
$RPM-Uvh
$RPM-Uvh
$RPM-Uvh
$YUM-yinstallyum-protectbase
$PERL-i-pe"s/(\[.*\])/\1\nprotect=yes/"/etc/yum.repos.d/{fedora*,livna*}
cd$DUMP_PATH
}

functionmost{
$RPM-Uvh
$RPM-Uvh
$RPM-Uvh
$YUM-yinstallyum-protectbase
$PERL-i-pe"s/(\[.*\])/\1\nprotect=yes/"/etc/yum.repos.d/{fedora*,livna*}
$RPM-e--nodepstotem-plparser.x86_64totem-plparser.i386totemtotem-mozplugin
$YUM-yinstalltotem-xinetotem-xine-plparsertotem-xine-mozpluginmozpluggermplayerplug-inxmmsxmms-mp3xmms-faad2gstreamer-plugins-uglygstreamer-plugins-badlibmadlibid3taglibdvdcssxine-lib-extras-nonfreelibquicktimevlcxine-lib-extraslibdvdnav
wgetwww1.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
tar-jxvfall-20071007.tar.bz2
mkdir-p/usr/local/lib/codecs
cpall-20071007/*/usr/local/lib/codecs
ln-sf/usr/local/lib/codecs/usr/lib/codecs&&ln-sf/usr/local/lib/codecs/usr/local/lib/win32&&ln-sf/usr/local/lib/codecs/usr/lib/win32
mkdir-p/usr/lib/mozilla/plugins
$YUM-yinstallcompat-libstdc -33compat-libstdc -296
$YUM-yinstallstreamtunerstreamripperk3b-extras-nonfreedvdstylermencoderdevedegdeskletsistanbulgnome-applet-netspeeddvdauthorktorrentamuleglunarclocknautilus-search-toolnautilus-open-terminalnautilus-image-converterunixODBC-develgstreamer-plugins-goodgstreamer-plugins-uglygstreamer-plugins-badunrarlamesoundconvertervncmacchangergdeskletsvlcgdeskcalgitsystem-config-bootgwgetdvdripalltraypam_keyringtorprivoxygtweakuignome-screensaver-frogsrss-glx-xsceensaverrss-glxgnome-speechgpartedgsynapticsgconf-editor
/sbin/chkconfigtoron
/sbin/chkconfigprivoxyon
/sbin/chkconfigNetworkManageron
sed-i.bak''/Option"Emulate3Buttons""yes"/a\
Option"SHMConfig""on"''/etc/X11/xorg.conf
/sbin/chkconfignetworkoff
/sbin/chkconfigisdnoff
/sbin/chkconfigyum-updatesdoff
$YUM-yinstallgcckernel-devel-$(uname-r)camstream
wget
wget
wget
tar-xvfsn9c1xx-1.48.tar.gz
tar-xvftrunk.tar.gz
tar-xvfgspcav1-20070110.tar.gz
cdgspcav1-20070110
make&&makeinstall
cd$DUMP_PATH
cdtrunk
make&&makeinstall
cd$DUMP_PATH
cdsn9c1xx-1.48
make&&makeinstall
cd$DUMP_PATH
wget
$RPM-UvhRealPlayer10GOLD.rpm
$YUM-yinstallflash-plugin.i386
mkdir-p/usr/lib/mozilla/plugins
$YUM-yinstallnspluginwrapper.{i386,x86_64}pulseaudio-libs.i386
mozilla-plugin-config-i-g-v
cd$DUMP_PATH
}


functioncam{
clear
$YUM-yinstallgcckernel-devel-$(uname-r)camstream
wget
wget
wget
tar-xvfsn9c1xx-1.48.tar.gz
tar-xvftrunk.tar.gz
tar-xvfgspcav1-20070110.tar.gz
cdgspcav1-20070110
make&&makeinstall
cd$DUMP_PATH
cdtrunk
make&&makeinstall
cd$DUMP_PATH
cdsn9c1xx-1.48
make&&makeinstall
cd$DUMP_PATH
}

functionmixed{
whiletrue;do
clear
echo"###################################################################"
echo"###Selectwhichonetoinstall###"
echo"###1)Limewire###"
echo"###2)Frostwire###"
echo"###3)RealPlayerGold10###"
echo"###4)backtomainmenu###"
echo"###################################################################"
readyn
case$ynin
1)limewire;break;;
2)frostwire;break;;
3)realplayer;break;;
4)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functionrealplayer{
clear
$YUM-yinstallcompat-libstdc -33compat-libstdc -296nspluginwrapper
wget
$RPM-UvhRealPlayer10GOLD.rpm
mkdir-p/usr/lib/mozilla/plugins
$YUM-yinstallnspluginwrapper.{i386,x86_64}pulseaudio-libs.i386
ln-sf/usr/lib64/mozilla/plugins/*/usr/lib64/firefox-*/plugins/
mozilla-plugin-config-i-g-v
cd$DUMP_PATH
}

functionlimewire{
clear
$YUM-yinstalllibXpcompat-libstdc -33compat-libstdc -296
wget
$RPM-Uvh--nodepsLimeWireLinux.rpm
cd$DUMP_PATH
}

functionfrostwire{
clear
$YUM-yinstalllibXpcompat-libstdc -33compat-libstdc -296
wget
$RPM-Uvh--nodepsfrostwire*.rpm
cd$DUMP_PATH
}


functiontouchpad{
$YUM-yinstallgsynaptics
sed-i.bak''/Option"Emulate3Buttons""yes"/a\
Option"SHMConfig""on"''/etc/X11/xorg.conf
cd$DUMP_PATH
}


functionfglrx{
$RPM-Uhv
$YUMinstallkmod-fglrxxorg-x11-drv-fglrxxorg-x11-drv-fglrx-libs-32bit
cd$DUMP_PATH
}

functionnvidia{
whiletrue;do
clear
echo"###################################################################"
echo"###Selectwhichdrivertoinstall###"
echo"######"
echo"###1)NvidiaFX(recomendrestartafterwards)###"
echo"###2)NvidiaMX(recomendrestartafterwards)###"
echo"###3)Atiusingkmod-fglrx(recomendrestartafterwards)###"
echo"###checkfirstifyoucardissupportedatAtiwebsite###"
echo"###4)Backtomainmenu###"
echo"###################################################################"
readyn
case$ynin
1)nvidiafx;break;;
2)nvidiamx;break;;
3)fglrx;break;;
4)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functiondrivers{
whiletrue;do
clear
echo"###################################################################"
echo"###Selectwhichdrivertoinstall###"
echo"######"
echo"###1)NvidiaorAtigraphicsdrivers###"
echo"###2)Wirelessdrivers###"
echo"###3)Webcamdrivers###"
echo"###4)Touchpadconfiguregsynaptics(restartrequired)###"
echo"###5)Lightscribe(toruntype4L-guiinaterminal###"
echo"###6)Backtomainmenu###"
echo"###################################################################"
readyn
case$ynin
1)nvidia;break;;
2)wireless;break;;
3)cam;break;;
4)touchpad;break;;
5)lightscribe;break;;
6)menu;break;;
*)echo"unknownresponse.Tryagain";;
esac
done
}

functionlightscribe{
wget
tar-xvflightscribe.tar.gz
$YUM-ylocalinstall/temp/lightscribe*.rpm4L*.rpm--nogpgcheck
cd$DUMP_PATH
}

functionbroadcom{
xterm$TOPL-bg"#000000"-fg"#99CCFF"-title"INSTALLINGBROADCOM43xxDRIVER"-e"$YUM-yinstallb43-fwcutter--nogpgcheck&&wget*&&cd/temp/broadcom*/kmod&&/usr/bin/b43-fwcutter-w/lib/firmwarewl_apsta.o"
/sbin/chkconfigNetworkManageron
/sbin/chkconfignetworkoff
cd$DUMP_PATH
}

functionmessage{
if[$WELCOME=1]
then
echoHello$(logname)
echo"WELCOMETOMYSCRIPT"
echo"THISISFORF8ONLY"
echo"ByDangermouse"
echo""
sleep5
else
echo"nowelcomemsgforyou"
fi
}

clear
message
mkdir$DUMP_PATH
cd$DUMP_PATH
menu
selectchoixin$CHOICES;do
if["$choix"="1"];then
abode
menu
elif["$choix"="2"];then
drivers
menu
elif["$choix"="3"];then
setsudo
menu
elif["$choix"="4"];then
java
menu
elif["$choix"="5"];then
google
menu
elif["$choix"="6"];then
mixed
menu
elif["$choix"="7"];then
personal
menu
elif["$choix"="8"];then
dvd
menu
elif["$choix"="9"];then
echo-e"\033[0m"
clear
echoScriptterminatedgoodbye$(logname)
exit
else
clear
menu
echo"################################################################"
echo"###Tryagainwrongnumber###"
fi
done
#END


fedorascipts.rar
下载本文示例代码
阅读(437) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~