#!/bin/bash
#This Bash Script Will Generate HTML Taken From User Desired Dir
#Greetings TO all and Mainly Sepultura && Crematory the bands i
#listen to while writting this shit.
#This is Under The GNU's GPL License All Copyrights For Me hipodilski
# For More -===www.pcfreak.cc===-
# my mail:root@pcfreak.cc
#Welcome See by yourself what are this is doing
welcome()
{
clear
printf "Welcome To The lsHTML generator\n"
printf "Written by hipodilski ver 1.0\n"
echo '=---------------------------='
printf "\n\n\n\n"
printf "Enter Desired Dir:"
read desdir
printf "Be Carefull never ever write name of currently existing and non\n"
printf "Empty file!!!!! You Are Warned\n"
printf "Enter Output HTML Name:"
read deshtml
printf "Enter Desired Colors For Links:"
read descolor
printf "Enter The Name Of The Main HTML:"
read back
a=0
b=1
c=0
}
# simple commands
simplicity()
{
cd $desdir
#touch $desdir/something
#ls * > something
miniloop=`wc -l $desdir/something | awk '{ print $1 }'`
}
# This Generates Links In the HTML
ahrefs()
{
printf "Generating:"
#echo "
" >> $deshtml
while [ "$a" -lt "$miniloop" ]; do
a=$(( $a + $b ))
name=`cat $desdir/something | head -n $a | tail -n 1 | head -n 1`
echo " $name " >> $desdir/$deshtml
echo "
" >> $desdir/$deshtml
echo -n "."
done
#echo "" >> $deshtml
echo
echo "Done."
}
# This Prints The Main Of The Page
headers()
{
echo '' > $deshtml
echo '' >> $deshtml
echo
printf "Desired TITLE of THe Page?:"
read topic
printf "Desired Size Of The Header Text[1..6]?:"
read size
printf "Header Text?:"
read htext
#printf "Do you want Generated Ahrefs to Be Centered?[y/n]:"
#read ans
#if [ "$ans" == "y" ] || [ "$ans" == "yes" ]; then
echo " $topic " >> $deshtml
echo '' >> $deshtml
echo '' >> $deshtml
echo "" >> $deshtml
echo "" >> $deshtml
echo " $htext " >> $deshtml
echo "" >> $deshtml
echo "
" >> $deshtml
}
# This Closes some tags in the html
endsection()
{
echo "
" >> $deshtml
echo "" >> $deshtml
echo "" >> $deshtml
echo " Back " >> $deshtml
echo "" >> $deshtml
echo '' >> $deshtml
echo '' >> $deshtml
echo '' >> $deshtml
echo '' >> $deshtml
}
# This is tha main procedure it invokes the rest
main()
{
welcome
simplicity
headers
ahrefs
endsection
}
main