Results 1 to 6 of 6
Hey I wrote a Bash Script to make someone who never used linux to Configure the system without any problems.
But, well i tested it and now I get Time ...
- 09-13-2007 #1
Bash Script Messed up my linux I guess
Hey I wrote a Bash Script to make someone who never used linux to Configure the system without any problems.
But, well i tested it and now I get Time Errors during boot and I know Ive made a mistake in the if trigger. (And I cant fix it)
Can anyone take a look at my script and give me some Advice on it?
Oh, btw the Echo stuff is all in Dutch..
Sorry about that..
Code:#! bin/bash (Ja, het is een BashScript.. :|) #SHOWELCOME clear #Eert maken we even Schoon #Ik weet dat dit makelijker kan met #cat bannner #But I dont give a Damn =) echo \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \Virtual\ Office\ Automatic\ Configuration\ \ \#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \ \ \Welcome\ in\ de\ TextBased Configer\ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \ \ \ Dit\ helpt\ u\ stap\ voor\ stap\ om\ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \Dit\ systeem\ klaar\ temaken\ voor gebruik\.\ \#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ Druk\ een\ Knop\ om\ te\ beginnen\. \ \ \ \#\#\# echo \#\#\#\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\#\# echo \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# read #SHOWWHATSINTHERE echo Dit zit er in de PCI-e Sloten. echo Vaak slim om opteschrijven ergens want dit heb je later nodig lspci echo Druk een knop om verder te gaan read #TIME AND DATE echo We gaan eerst de Tijd Goed Insellen echo Het formaat is: echo MMDDhhmmYYYY echo Dus met 1 Maart 2003 4:50 krijgen we echo 020104502003 echo Als de datum && date && echo is druk gewoon op Enter echo Geef datum in: read DATE date $DATE #TIMEZONE echo Timezone gaan we instellen echo Druk een knop om verder te gaan read nano -w /etc/conf.d/clock #NETWORK SETUP echo Nu gaan we het netwerk instellen ifconfig echo Host Naam \= hostname echo DNS Domein Naam \= dnsdomainname echo Klopt dit? \(j\/n\) read YESNO if "$YESNO" = "$NO"; then nano -w /etc/conf.d/net fi #OTHER CONFIG echo en nu komen er nog wat configfiles echo druk een Knop om verder te gaan. read nano -w /etc/conf.d/rc nano -w /etc/conf.d/keymaps nano -w /etc/make.conf #KERNEL echo Nu word de Kernel gemaakt. echo Let Goed op dat de volgende dingen AANSTAAN! echo File systems \-\-\> echo \[\*\] Qouta support echo \<M\> Qouta format v2 support echo Zorg dat het ext2 \+ ext3 Filesystem aanstaat. echo Druk op een knop om verder te gaan. read mount /dev/hdd1 cd /usr/src/linux make menuconfig make&&make modules_install mv /boot/kernel-2.6 /boot/kernel-2.6.backup cp arch/i386/boot/bzImage /boot/kernel-2.6 #PASSWORD echo Er moet een Sterk root Password gekozen worden. echo Zorg dat het wachtwoord minimaal\: echo \ \ \-\ 7 Tekens is echo \ \ \-\ 2 Cijfers er in heeft die niet naast elkaar staan echo \ \ \-\ 1 Raar teken echo \ \ \-\ NERGENS opgeschreven word. echo echo Een mooi voorbeeld van een SterkWachtwoord dat aardig makelijk te onthouden is echo 1mvBv1sWWd\@mtoi echo Dat is de zin daarboven in een wachtwoord formaat. echo Geef nu uw nieuwe wachtwoord in. passwd #EMERGE echo Voer de alle namen in van alle extra software die geinstalleerd gaat worden. read EMERGE emerge -av $EMERGE #CLOSE THIS ALL clear cowsay NU hopen we dat het systeem werkt. echo Druk een knop om het Systeem opnieuw optestarten. read cowsay -f dragon-and-cow REBOOT!! sleep 1 reboot
- 09-13-2007 #2Just Joined!
- Join Date
- Aug 2007
- Posts
- 37
"$NO" is undefined. Try this:
By the way, you don't need all those back-slashes "\" in the banner, just use single quotes to protect your text:Code:echo "Klopt dit? (j/n)" read -s YESNO if [ "$YESNO" == "n" ]; then nano -w /etc/conf.d/net fi
Code:echo '################################################' echo '### ###' echo '### Virtual Office Automatic Configuration ###' echo '### ###' echo '### Welcome in de TextBased Configer ###' echo '### ###' echo '### Dit helpt u stap voor stap om ###' echo '### Dit systeem klaar temaken voor gebruik. ###' echo '### ###' echo '### Druk een Knop om te beginnen. ###' echo '### ###' echo '################################################'
- 09-13-2007 #3
- 09-13-2007 #4Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Your shebang line needs a slash not a space after the #!.
And I'm not sure that extra text on the shebang line is A Good Idea, either.
- 09-14-2007 #5
- 09-14-2007 #6Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044


Reply With Quote
