Skip to content

A simple html website of hello world using the bash script

Notifications You must be signed in to change notification settings

vyjith/simplewebsite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

simplewebsite html website

Builds

A simple html website of hello world using bash script


prerequisite

sudo yum install git -y

How to use the scipt

git clone https://github.com/vyjith/simplewebsite

cd simplewebsite

chmod +x simplewebsite.sh

Script running

bash simplewebsite.sh

Soruce code is the following


#! /bin/bash

bc_root(){
if [ "$EUID" == 0 ]
then
        bc_installrequiredpackage
else
        echo "This script must be run as root adminstrator, please enter the command sudo su on the terminal. Thank you"
        exit 1
fi
}

bc_installrequiredpackage(){
echo -n "Please let me know if you want to install one website, plesae enter yes or no! (y/n) : "
read install
if [ "$install" == y ]
then
        bc_install
else
        echo "I am exting from here"
        exit 1
fi
}
bc_httpd(){
        echo "Pleasae wait a moment, while installing the httpd service on this machine.................................................................................................................................................................................................................................................................................................................................................................................."
        yum install httpd -y
        service httpd start
        echo "The httpd installation has been successfully completed."
        echo ""
}
bc_website(){

cat > /var/www/html/index.html << EOF
Hello World!
EOF
}

bc_install(){
        bc_httpd
        bc_website
}

bc_main(){

        bc_root
}
bc_main
exit

About

A simple html website of hello world using the bash script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages