#!/bin/sh
##############################################################################
# Comment the line below if you wish to configure all the parameters within
# this script and NOT interactively
#
installmode=interactive
#
#..################################################################################__#
#..#Set the time format#__#
#..#SafeSquid creates logs and backups, and names them with the date and time when this is done#__#
#..#The default mode is +%Y-%m-%d-%H:%M:%S#__#
#..#Please do not change this, unless you prefer a different time format.#__#
#
#cur_time=`eval date +%Y-%m-%d-%H:%M:%S`
#--echo "sample   +%Y-%m-%d-%H:%M:%S"
#--echo "Enter time format if you want to change else leave blank"
#--read cur_time1
#--if [ ! -z "$cur_time1" ]; then
#--cur_time=`eval date $cur_time1`
#--else
cur_time=`eval date +%Y-%m-%d-%H:%M:%S`
#--fi
#
#..#########################################################################__#
#
#..#The program Name by which safesquid will be referred. #__#
#..#for example if you wish to refer to safesquid as "contentfilter"set PROGS=contentfilter#__#
#
#   PROGS=safesquid
#--echo "Default is PROGS=safesquid"
#--read PROGS1
#--if [ ! -z "$PROGS1" ]; then
#--PROGS=$PROGS1
#--else
PROGS=safesquid
#--fi
#
#..##########################################################################__#
#..#Directory path or folder that which will contain all the binaries of SafeSquid#__#
#..#The install script will first create a folder in the $PREFIX directory named $PROGS#__#
#..#and then copy all the necesary files into this folder.#__#
#
#..#for example: if you have set PROGS=safesquid and PREFIX=/opt then the install script will copy #__#
#..#all the necesary files into /opt/safesquid folder#__#
#
#   PREFIX=/opt
#
#--echo "Default is PREFIX=/opt"
#--read PREFIX1
#--if [ ! -z "$PREFIX1" ]; then
#--PREFIX=$PREFIX1
#--else
PREFIX=/opt
#--fi
#
#..###########################################################################__#
#..#System path to save safesquid binary. #__#
#..#By default it will be /usr/local/bin #__#
#..#Default Path for "system" directory is /usr/local/bin please check the documentation#__#
#..#of your operating system if you require to change it.#__#
#
#   bindir=/usr/local/bin
#
#--echo "Default is bindir=/usr/local/bin"
#--read bindir1
#--if [ ! -z "$bindir1" ]; then
#--bindir=$bindir1
#--else
bindir=/usr/local/bin
#--fi
#
#..############################################################################__#
#..#System Cache Path.#__#
#..#SafeSquid can cache HTTP / FTP content.#__#
#..#Set the directory where safesquid can store this cached data.#__#
#
#   cache=/var/cache
#
#--echo "Default is cache=/var/cache "
#--read cache1
#--if [ ! -z "$cache1" ]; then
#--cache=$cache1
#--else
cache=/var/cache
#--fi
#
#..############################################################################__#
#..#Directory path to save startup script required to start/stop/restart safesquid service.#__#
#..#Default it will be get stored at /etc/rc.d/init.d#__#
#..#But if your operating system has different path then you can change the path.#__#
#
#   initdir=/etc/init.d
#
#--echo "Default is initdir=/etc/init.d"
#--read initdir1
#--if [ ! -z "$initdir1" ]; then
#--initdir=$initdir1
#--else
initdir=/etc/init.d
#--fi
#
#..#############################################################################__#
#..#The installation script uses this command for copying necessary files of SafeSquid#__#
#..#with proper permissions and user ownwership.#__#
#..#Default Path for "install" command is /usr/bin/install please check the documentation #__#
#..#of your operating system if you require to change it.#__#
#
#   installcmd=/usr/bin/install
#
#--echo "Default is installcmd=/usr/bin/install"
#--read installcmd1
#--if [ ! -z "$installcmd1" ]; then
#--installcmd=$installcmd1
#--else
installcmd=/usr/bin/install
#--fi
#
#..##############################################################################__#
#..#The results of various operation carried out during the installation process are logged.#__#
#..#A new install log is created everytime the installation process is carried out.#__#
#..#The filename of the log is suffixed with the current date and time#__#
#..#for example if you set installLog=/root/install-logs #__#
#..#and the installation process was started at 12-Jan-2004 13:44:32#__#
#..#you will find the installation log reported as#__#
#..#/root/install-logs/safesquid-install-log-2004-Jan-12-13:44:32#__#
#
#   installLogdir=/root/install-logs
#
#--echo "Default is installLogdir=/root/install-logs"
#--read installLogdir1
#--if [ ! -z "$installLogdir1" ]; then
#--installLogdir=$installLogdir1
#--else
installLogdir=/root/install-logs
#--fi
#
#..#Install Log File name#__#
#
#   installLog=$installLogdir/safesquid-install-log-$cur_time
#
#--echo "Default is installLog=$installLogdir/safesquid-install-log-$cur_time "
#--read installLog1
#--if [ ! -z "$installLog1" ]; then
#--installLog=$installLogdir/$installLog1-$cur_time
#--else
installLog=$installLogdir/safesquid-install-log-$cur_time
#--fi
#
#
#..########################################################################__#
#
#..#SafeSquid Proxy Service Address#__#
#
#..########################################################################__#
#
#..#Port Number on which safesquid service will listen.#__#
#..#This is the port on which SafeSquid sevice will be listening for incoming #__#
#..#connections.#__#
#..#If you are installing SafeSquid in slave mode then you should set it to the #__#
#..#port on which the#__#
#..#master proxy is listening.#__#
#
#    port=8080
#
#--echo "Default is port=8080"
#--read port1
#--if [ ! -z "$port1" ]; then
#--port=$port1
#--else
port=8080
#--fi
#
#..#This is the IP address of the proxy server on which safesquid service is#__#
#..#running.#__#
#
#    proxy_ip=127.0.0.1
#
#--echo "Default is proxy_ip=127.0.0.1"
#--read proxy_ip1
#--if [ ! -z "$proxy_ip1" ]; then
#-- proxy_ip=$proxy_ip1
#--else
proxy_ip=127.0.0.1
#--fi
#
#..#CAUTION: If you are installing SafeSquid in master mode and you want other slave proxies#__#
#..#to share their configuration settings from this server then the slave proxies MUST set#__#
#..#their master_host_ip to this proxy_ip#__#
#
#..#########################################################################__#
#
#..# SafeSquid Browser Based GUI Service Address#__#
#
#..#########################################################################__#
#
#..# I.P. address or Hostname of the proxy server where you want to install #__#
#..#safesquid.#__#
#..#This is the I.P. address or Hostname on which SafeSquid's Browser-based #__#
#..#Interface can be accessed.#__#
#
#..#By default SafeSquid Proxy service will be accessible on all the I.P. #__#
#..#addresses assigned to the system on which SafeSquid will be installed.#__#
#..#The Top Menu of SafeSquid Browser Based GUI Service will also be accessible,#__#
#..#on all the I.P.s BUT to make any #__#
#..#configuration changes you must access the interface via this I.P or hostname, #__#
#..#if you want to make any changes. If you change it here then you don't #__#
#..#have to set it via "config.xml" file#__#
#
#..#For example: Suppose you wish to install safesquid on a server named 'ganga.jamuna.tld' and #__#
#..#the I.P. Address of ganga.jamuna.tld is 192.192.192.192; #__#
#..#and safesquid has been set to run on port 8080. Now, if you set hostname=ganga.jamuna.tld#__#
#..#then if you wish to access the SafeSquid's Browser based GUI,#__#
#..#you MUST access http://ganga.jamuna.tld:8080/safesquid.cfg from your browser.#__#
#..#However, if you set hostname=192.192.192.192 then you should accesss #__#
#..#http://192.192.192:8080/safesquid.cfg from your browser to view and make #__#
#..#configuration settings.#__#
#
#   hostname=localhost
#
#--echo "Default is hostname=localhost"
#--read hostname1
#--if [ ! -z "$hostname1" ]; then
#--hostname=$hostname1
#--else
hostname=127.0.0.1
#--fi
#
#..#######################################################################__#
#
#..#Default user and group to run safesquid process#__#
#
#..#######################################################################__#
#..#Set group=root if you wish to use PAM Authentication or install in SLAVE mode#__#
#..#or if you will be using other third-party s/w that require root-level access#__#
#..#Similarly you can change the user to anything else, though it is not very necessary.#__#
#
#   user=ssquid
#   group=ssquid
#
#--echo "Default is user=ssquid"
#--read user1
#--if [ ! -z "$user1" ]; then
#-- user=$user1
#--else
user=ssquid
#--fi
#
#--echo "Default is group=ssquid"
#--read group1
#--if [ ! -z "$group1" ]; then
#-- group=$group1
#--else
group=ssquid
#--fi
#
#..#######################################################################__#
#
#..#Start SafeSquid Services#__#
#..#safesquid services will automatically start at the end of installation#__#
#..#If you wish to start the services manually after installation comment the next line#__#
#
#   startss=y
#
#--echo "Default is startss=y"
#--read startss1
#--if [ ! -z "$startss1" ]; then
#-- startss=$startss1
#--else
startss=y
#--fi
#
#..#######################################################################__#
#
#..#Add SafeSquid to List of Daemons#__#
#..#safeSquid services will be automatically added to the list of bootup services#__#
#..#If you do not wish to include safesquid in the list of bootup services #__#
#..#comment the next line #__#
#
#   bootup=y
#
#--echo "Default is bootup=y"
#--read bootup1
#--if [ ! -z "$bootup1" ]; then
#-- bootup=$bootup1
#--else
bootup=y
#--fi
#
#######################################################################
#
#It is mandatory that you must confirm, that you have read
#and are agreeable to the End-User License Agreement, enclosed, alongwith the software package.
#Please find the EULA.TXT, read it and then uncomment the following line, if you are agreeable,
#for the installation to proceed.    
#   I_AGREE=YES
#
########################################################################
#
#It is mandatory that you must confirm, that you have completely reviewed the
#configuration settings, above, for the installation to proceed.
#If you have properly reviewed the configuration settings above,
# then just uncomment the following line

#  INSTALL_OK=YES
#
#..#########################################################################__#

#..#End of Configuration Settings#__#
#
########################################################################
########################################################################
#                                                                      #
#          DO NOT EDIT ANYTHING BELOW THIS LINE                        # 
#                                                                      #
########################################################################
########################################################################

if [ ! -z "$installmode" ]; then
        echo "Installing in interactive mode"
 	# interactive
	sed -e "s|#\.\.#|echo \"|g" $0 > install1
	sed -e "s|#\_\_#|\"|g" install1 > install-interact1
	sed -e "s|#\-\-|\ |g" install-interact1 > install-interact2
	rm -rf install1
	rm -rf install-interact1
	sed '318,331d' install-interact2 >install-interact 
	rm -rf install-interact2
	chmod 755 install-interact
	./install-interact
	exit 0
fi
#
#
#
#
#
#
# Install Log File name
#
   installLog=$installLogdir/safesquid-install-log-$cur_time
#
# The directory path to save necessary files i.e. /opt/safesquid.
# If you want to save the program in other directory you can change the variable PREFIX's value.
#
   userdir=${PREFIX}/${PROGS}
#
# Path of directory to save pid file of safeqsuid process 
#
   piddir=${userdir}/run/ 
#
#
# Filename of safesquid pid file which store the Process ID number of running Safesquid
#
   pidfile=${piddir}${PROGS}.pid
#
#
#
# Path of directory containing logs of safesquid 
#
   logdir=${userdir}/logs 
#
#
#
# Path for cache directory required to store cache files
#
   cachedir=$cache/${PROGS}
#
#
# Directory path to save backup of old installed safesquid 
#
   backupdir=${PREFIX}/${PROGS}-backup 
#
# Path of init script of safesquid 
#
   startsafesquid=$initdir/${PROGS}
#
# Default safesquid log file path
#
   safesquid_log=$logdir/${PROGS}.log
#
# Default path for safesquid log in squid's access log file format 
#
   access_log=$logdir/access.log
#
# Default path for safesquid's config.xml file
#
   config=$userdir/config.xml
#
# Default path for safesquid's section.xml file
#
   section=$userdir/section.xml
#
# Path for "pam.d" directory
   pamdir=/etc/pam.d
#
# Set log level as per safesquid 
   loglevel=1
#
# Version No. of safesquid
#
   version=4.0.4.2
#
###############################################################################
#                                                                    	      #	
#               Actual Installation will start now                            #
#                                                                    	      #	
###############################################################################
#
mkdir $installLogdir
#
if [ "$I_AGREE" != "YES" ]; then
	vi -Rn +1 EULA.TXT
        echo "Please Confirm that you have read the EULA.TXT, and you agree to its contents"
        echo "(YES/NO)"
        read I_AGREE
		if [ $I_AGREE = "YES" ]||[ $I_AGREE = "yes" ]; then
        	echo "Thank You, for your patience and the efforts taken to read the EULA.TXT" >> $installLog
		else
        	echo "Sorry, the installation cannot proceed without your consent."
        	echo "EULA.TXT was not accepted" >> $installLog
        	exit 0
		fi
fi

if [ "$INSTALL_OK" != "YES" ]; then
        echo "Please Confirm that you have verified the configuration setings"
        echo "(YES/NO)"
        read INSTALL_OK
		if [ $INSTALL_OK = "YES" ]||[ $INSTALL_OK = "yes" ]; then
        	echo "Starting Installation of SafeSquid" >> $installLog
		else
        	echo "OK. Please review the install-time configuration settings"
        	echo "Configuration Settings not reviewed" >> $installLog
        	exit 0
		fi
fi
#
#
echo "You are installing Free Edition - $version of safesquid"
echo "You are installing Free Edition - $version of safesquid" > $installLog
cp bench.xml config.xml.orig
#
###############################################################################
#
#      Verifying the Installation Environment required for Safesquid          #
#
###############################################################################

echo "Checking System Configuration ............"
echo "Checking System Configuration ............" >> $installLog
OS=`uname -s`

echo 
echo "$OS System detected."

if [ "$OS" = "Linux" ]; then
	echo "$OS System detected." >> $installLog
else 
#If Operating System is not Linux  then exit 
	echo "This script can only run on Linux OS..."
	echo "This script can only run on Linux OS..." >> $installLog	
	exit 0
fi

#Taking System version information into Install Log 
echo "Linux Distribution:" >> $installLog
cat /proc/version >> $installLog

echo " "  >> $installLog

echo "Memory Information:"  >> $installLog
cat /proc/meminfo >> $installLog

echo " "  >> $installLog

echo "CPU Information:"  >> $installLog
cat /proc/cpuinfo >> $installLog

#Checking if you are logged in as a 'root' or not 
echo "Checking...for root"
echo "Checking...for root" >> $installLog
QUID=`whoami`
echo "Identity :" $QUID
echo "Identity :" $QUID >> $installLog
echo ""

#if not logged in as a 'root' then exit 
if [ "$QUID" != "root" ]; then
	echo "You are logged in as" $QUID
	echo "You may NOT have the privileges to install SafeSquid" 
	echo "Please Login As ROOT, and start the installtion process again"
	echo "Please Login As ROOT" >> $installLog
	exit 0
fi

#when user is 'root' then check if any of the required library file is available or not. If not available then exists. 
echo "Checking... for necessary shared library:"
echo "Checking... for necessary shared library:" >> $installLog

echo "safesquid requires following libraries" >> $installLog
echo "safesquid requires following libraries"
ldd -v safesquid
ldd -v safesquid >> $installLog

echo "Are all library files present?(y/n)"
read ans
if [ $ans = "n" ]||[ $ans = "N" ]; then
	echo "We can not continue with installation procedure." 
        echo "You need to install required library for successful installation of safesquid"
 	echo "Exiting from execution of Installaton script due to absence of required library files"
	echo "Exiting from execution of Installaton script due to absence of required library files" >> $installLog
	exit
fi

###############################################################################
#    Installation will start after proper Installation Environment            # 
###############################################################################

#If safesquid is already installed and if it is running ,then stop it before starting installation process
if [ -e $pidfile ]; then
	echo "Safesquid is already running ...Stopping SafeSquid"
	echo "Safesquid is already running ...Stopping SafeSquid" >> $installLog
	$startsafesquid stop
fi

if [ $user != 'root' ]; then
	echo "Adding user $user with group $group to system"
	echo "Adding user $user with group $group to system" >> $installLog
	groupadd $group >> $installLog
	useradd $user -g $group >> $installLog
fi
sed -e "s|USER=ssquid|USER=$user|g" init/safesquid.orig > init/safesquid1	
sed -e "s|GROUP=ssquid|GROUP=$group|g" init/safesquid1 > init/safesquid.orig
sed -e "s|BASE=/opt/safesquid|BASE=$userdir|g" init/safesquid.orig > init/safesquid1	
sed -e "s|PROGRAM=\$BASE/safesquid|PROGRAM=\$BASE/${PROGS}|g" init/safesquid1 > init/safesquid.orig
sed -e "s|PROXY_IP=127.0.0.1|PROXY_IP=$proxy_ip|g" init/safesquid.orig > init/safesquid1
sed -e "s|LOGFILE=\$BASE/logs/safesquid.log|LOGFILE=$safesquid_log|g" init/safesquid1 > init/safesquid.orig
sed -e "s|PIDFILE=\$BASE/run/safesquid.pid|PIDFILE=$pidfile|g" init/safesquid.orig > init/safesquid1
sed -e "s|SQUIDLOGFILE=\$BASE/logs/safesquid\-squid.log|SQUIDLOGFILE=$access_log|g" init/safesquid1 > init/safesquid.orig
sed -e "s|CONFIG=\$BASE/config.xml|CONFIG=$config|g" init/safesquid.orig > init/safesquid1 
sed -e "s|SECTION=\$BASE/section.xml|SECTION=$section|g" init/safesquid1 > init/safesquid.orig
sed -e "s|LOGLEVEL=16777215|LOGLEVEL=$loglevel|g" init/safesquid.orig > init/safesquid1
sed -e "s|HOSTNAME=localhost|HOSTNAME=$hostname|g" init/safesquid1 > init/safesquid.orig
sed -e "s|PORT=8080|PORT=$port|g" init/safesquid.orig > init/safesquid1

cp init/safesquid1 init/safesquid.orig
cp init/safesquid.orig init/safesquid	
rm -f init/safesquid1

#   Checking if old Directory present if you are running in master mode
echo "Checking for previous installation in $userdir ....."
if [ -e $userdir ]; then
	echo "$userdir exists, not creating..."
     	echo "$userdir exists, not creating..." >> $installLog
#   IF old Install Directory exists, then taking backup of old user directory in the folder name consist of date and time of installation

	backupdir=$backupdir/safesquid-backup-$cur_time
	echo "Taking backup of old safesquid folder in $backupdir"
	echo "Taking backup of old safesquid folder in $backupdir" >> $installLog

	mkdir -p $backupdir >> $installLog
	cp -r $userdir/* $backupdir >> $installLog	
        echo "You have set the Proxy Ip address as $proxy_ip."
        echo "You have set the Proxy Ip address as $proxy_ip." >> $installLog

	if [ -d $cachedir ]; then
                chown $user:$group $cachedir >> $installLog
        else
                mkdir -p $cachedir  >> $installLog
                chown $user:$group $cachedir >> $installLog
        fi
        sed -e "s|>/var/cache/safesquid<|>$cachedir<|g" config.xml.orig > config.xml
	echo "Copying new config.xml to directory $userdir with $user:$group user permission"
	echo "Copying new config.xml to directory $userdir with $user:$group permission" >> $installLog
	mv $config $userdir/config.xml.old >> $installLog
	mv $section $userdir/section.xml.old >> $installLog
	$installcmd -m0644 -g $group -o $user config.xml $config  >> $installLog
	$installcmd -m0644 -g $group -o $user section.xml $section >> $installLog
	chown $user:$group $userdir/*.xml >> $installLog
	if [ -d $bindir ]; then
		$installcmd -m0711 safesquid $bindir/${PROGS} >> $installLog
	else
		mkdir -p $bindir >> $installLog
		$installcmd -m0711 safesquid $bindir/${PROGS} >> $installLog
	fi
	$installcmd -m0711 safesquid $userdir/${PROGS} >> $installLog
	if [ -d $logdir ]; then
		chown $user:$group -R $logdir >> $installLog
	else	
		mkdir -p $logdir >> $installLog
		$installcmd -m0644 -g $group -o $user safesquid.log $safesquid_log
	fi	
	if [ -d $piddir ]; then
		chown $user:$group $piddir >> $installLog
	else
		mkdir -p $piddir >> $installLog
		chown $user:$group $piddir >> $installLog
	fi
	cp -f init/safesquid $initdir/${PROGS} >> $installLog
	cp -f pam.d/safesquid $pamdir/${PROGS}
	chmod 755 $startsafesquid >> $installLog
else
	echo "$userdir not exists..." 
	echo "$userdir not exists..." >> $installLog
	mkdir -p $cachedir >> $installLog
        sed -e "s|>/var/cache/safesquid<|>$cachedir<|g" config.xml.orig > config.xml
        chown $user:$group $cachedir >> $installLog
	echo "Creating working directory $userdir..."
      	echo "Creating working directory $userdir...">> $installLog
      	mkdir -p $userdir >> $installLog
      	mkdir -p $logdir >> $installLog
      	mkdir -p $piddir >> $installLog
	$installcmd -m0644 -g $group -o $user config.xml $config >> $installLog
      	$installcmd -m0644 -g $group -o $user section.xml $section >> $installLog
	chown $user:$group $logdir >> $installLog
	chown $user:$group $piddir >> $installLog
	if [ -d $bindir ]; then
       		$installcmd -m0711 safesquid $bindir/${PROGS} >> $installLog
	else
     	  	mkdir -p $bindir >> $installLog >> $installLog
		export PATH=$PATH:$bindir >> $installLog	
       		$installcmd -m0711 safesquid $bindir/${PROGS} >> $installLog
	fi
	$installcmd -m0711 safesquid $userdir/${PROGS} >> $installLog
	$installcmd -m0644 README $userdir/ >> $installLog
        cp -f init/safesquid $initdir/${PROGS} >> $installLog
	cp -f pam.d/safesquid $pamdir/${PROGS}
        chmod 755 $startsafesquid >> $installLog
	$installcmd -m0644 -g $group -o $user safesquid.log $safesquid_log
fi
rm -f config.xml.orig

if [ $startss = "y" ] ; then
	echo "Starting SafeSquid...."
	echo "Starting SafeSquid...." >> $installLog
	$startsafesquid start >> $installLog
else

	echo "You can start safesquid proxy by typing on command prompt...."
	echo "You can start safesquid proxy by typing on command prompt...." >> $installLog

	echo "$startsafesquid start" 
	echo "$startsafesquid start" >> $installLog
fi

if [ $bootup = "y" ] ; then

	echo "Adding safesquid service to list of bootup services"
	echo "Adding safesquid service to list of bootup services" >> $installLog
	if [ -e /sbin/chkconfig ]; then
		chkconfig --list ${PROGS} >> $installLog
		retc=`eval echo $?`	
		if [ $retc  = "1" ]; then
			echo "Adding ${PROGS} to list of daemons..."
                      	`chkconfig --add ${PROGS}`			
		else
			echo "Safesquid is already present in the list of startup services... "	
		fi
	else 
		if [ -e /usr/sbin/update-rc.d ]; then
			update-rc.d ${PROGS} defaults
		fi
	fi
else

	echo "Installer was unable to add Safesquid to startup services"
	echo "Installer was unable to add Safesquid to startup services" >> $installLog
fi
echo "#################################################################"
echo "#       Installation of SafeSquid is completed                  #"
echo "#################################################################" 
echo "#################################################################" >> $installLog
echo "#       Installation of SafeSquid is completed                  #" >> $installLog
echo "#################################################################" >> $installLog
echo "Install log is created in $installLog file" 
echo "Configuration Settings" >> $installLog
echo  "current time = " $cur_time >>  $installLog
echo "PROGRAM NAME = " $PROGS >> $installLog
echo " Directory path containing binary =" $PREFIX >> $installLog
echo "Base directory Path= " $PREFIX1 >> $installLog
echo " System path to save safesquid binary= " $bindir >> $installLog
echo " System Cache Path = " $cache >> $installLog
echo  " Directory path to save startup script = " $initdir >> $installLog
echo " Install Command path = " $installcmd >> $installLog
echo " Safesquid port = " $port >> $installLog
echo  "SafeSquid Host IP = "  $proxy_ip >> $installLog
echo  "SafeSquid Hostname = "  $hostname >> $installLog
echo " User of SafeSquid = " $user >> $installLog
echo " Group of Safesquid = " $group >> $installLog
echo " Start variable (true or false) = " $startss >> $installLog
echo " Boot Variable (true or false) = "  $bootup >> $installLog
echo " directory path to save necessary files ="  $userdir >> $installLog
echo " Filename of safesquid pid file = " $pidfile >> $installLog
echo "Path of directory containing logs of safesquid=" $logdir >> $installLog
echo "Path for cache directory =" $cachedir >> $installLog
echo " Directory path to save backup= " $backupdir  >>  $installLog
echo "Install log is created in $installLog file" >> $installLog
