#!/bin/bash # This Is Free Software If I could to to talk like software for it # It's Licensed Under THe GPL Licence see GPL License for more info # COPYRIGHT (C) Georgi Dimitrov # email:root@pcfreak.cc # site:www.pcfreak.cc # IRC Chan on -=UNI-BG=- #pcfreak preferred irc server debian.spnet.net # Greetings Fly To: |Vaso|,|Pro-XeX|,|Krassswr|,|STRASHARO|,|Indjeto|, # |joEjoE|,|Bomzh|,|dr0p|,|Nomen_Omen|,|PsioN|,|SIC-a| and everyone other # Who Feels Free and Stays Free... ! # Most Of the Time Writting This I was listening to Pro-XeX's -- Izdunkata # :]]] Right Now I'm Listening Evereve all fans of gothic like me enjoy #Simple Bla Bla Function begin() { clear printf "\t\t--||HTML Bash Generator by hipopodilski||--\n\t" printf "\t=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" printf "\n\n\n" n=0 z=1 h=0 } # Help Commands Function -- really Bad Written Right:]] commands() { echo printf "\t\tAvailable Commands are:\n" printf "\t\t-----------------------\n" echo '+_______________________________________________________________+' echo '|BR=(next line), LINK=(a href to name), P=(new paragraph) |' echo '|HR=(print line), H1, H2, H3, H4, H5, H6=(headers (1..6)) |' echo '|H1, H2, H3, H4, H5, H6-=headers (1..6), FS=font size(1..7) |' echo '|FC=(font color), BODY=(body of the page),LYNX=(view with lynx) |' echo '|TITLE=(title of the page),CLS=(clear screen) |' echo '|HTML=(Begin Of The HTML), ENDHTML=(End Of The HTML) |' echo '|ENDBODY=(End Of HTMLs Body),ENDFONT=(End Of Used Font) |' echo '|LS=(LIST FILE DIRS), DELL(Deletes One Of The Edited Page) |' echo '|VIEWSOURCE=(view your html source),QUIT(QUITS) |' echo '|PLAIN=(Adds Plain Text),CENTER=(Centers text) |' echo '|ENDCENTER=(CLOSES TAG CENTER),OKOFF=(Turns off The Ok Messages)|' echo '|OKON=(Turns The OK Messages After Execute of Command again) |' echo '|OPEN=(opens Different from the now generated HTML) |' echo '|DELCUR=(deletes Currently opened file) |' echo '|BODYBG=(Changes Bodys Background Color) |' echo '\_______________________________________________________________/' echo ; echo '-=To Quit type EXIT or Press Ctrl-C=-' } #This Traps Interrupts Coming From Ctrl-C And runs The bigfun Function trap inter INT inter() { clear bigfunc exit 0 } #Works Up To here -- This Is left from the time I was isolating errors:] #This Reads The Filename and creates The File If it doesn't exist filename() { echo echo 'File Name To Generato *.html or *.htm' echo -n 'Enter file name:' read filen touch $filen #cat /dev/null > $filen } # This Is The Core Of The Script...Scripters Enjoy:]] bigfunc() { OK='OK' echo "" >> $filen echo "" >> $filen while [ "$h" -lt "$z" ]; do echo -n 'Command:' read command #Works Up To Here case $command in BR) echo "
" >> $filen echo $OK ;; LINK) echo -n 'Enter link to:' read name echo " $name " >> $filen echo $OK ;; P) echo "

" >> $filen echo $OK ;; HR) echo -n 'Enter width:' read width echo -n 'Enter height:' read height echo "


" >> $filen echo $OK ;; H) echo -n 'Enter Heading 1-6' read heading echo "" >> $filen echo $OK ;; FS) echo -n 'Enter Font size:' read fontsize echo "" >> $filen echo $OK ;; FC) echo 'Font Colors are one of the english color names' echo -n 'Enter Font Color:' read colorname echo "" >> $filen echo $OK ;; BODY) xa='yes' echo 'Do you want BG Image?' echo 'If yes type (yes) and Give The picture below' echo -n 'yes/no:' read answ1 if [ "$answ1" == "$xa" ]; then echo -n 'Picture Name:' read answer echo "" >> $filen else echo "" >> $filen fi echo $OK ;; TITLE) echo -n 'Enter Title of the page:' read anstitle echo " $anstitle " >> $filen echo $OK ;; HEAD) #echo 'Using Head: First Use HEAD To open HEAD then use ENDHEAD to close HEAD' #echo 'You may use TITLE between THE opening and closing HEAD to set page TITLE' echo "" >> $filen echo $OK ;; ENDHEAD) echo "" >> $filen echo $OK ;; ENDFONT) echo "" >> $filen echo $OK ;; EXIT) clear printf "\n\n" printf "\v\a\tHope You-ve enjoyed .. see www.pcfreak.cc for more stuff..\n" printf "\tAnd Stay Free\n" exit 0 ;; LYNX) lynx $filen trap inter INT ;; CLS) clear ;; HTML) echo "" >> $filen echo $OK ;; ENDHTML) echo "" >> $filen echo $OK ;; VIEWSOURCE) cat $filen | less echo $OK ;; LS) echo -n 'DIR:' read list ls -F $list echo $OK ;; HELP) commands echo $OK ;; DELL) echo printf "Line Num:" read linenum linenum1=$(($linenum - $z)) head -n $linenum1 $filen > .filen1 cat .filen1 > $filen echo "line $linenum Deleted." ;; PLAIN) echo -n 'Plain Text:' read plain echo $plain >> $filen echo $OK ;; CENTER) echo "
" >> $filen echo $OK ;; OFFOK) OK='' ;; ONOK) OK='OK' ;; OPEN) filename ;; DELCUR) rm -f $filen ;; BODYBG) printf "BGColor:/n" read bgcolor echo "" >> $filen ;; ENDCENTER) echo "
" >> $filen echo $OK ;; QUIT) clear printf "\n\n" printf "\v\a\tHope You-ve enjoyed .. see www.pcfreak.cc for more stuff..\n" printf "\tAnd Stay Free\n" exit 0 ;; *) echo "Unknown Command." ;; esac done } main() { begin commands filename bigfunc } main