I would like to write a script to read this yast2_vhost.conf file.
if the word
maintenance exit then end script otherwise continue to
execute a few more commnands.
I have a file call yast2_vhost.conf and it contain multiple entries call
maintenance.html
/srv/www/maintenance/
/srv/www/maintenance/maintenance.html ..etc
Here is what I have and it doesn't work correctly.
How can I perform a grep and it will give me a contain word (
maintenance) instead of a string or the whole line of info.
or is there a CONTAIN in IF statement ?
******************************************************
#!/bin/ksh
result=$(grep "maintenance" /etc/apache2/yast2_vhost.conf)
if [[ $result = maintenance ]]; then
echo "you messed up"
else
cp /etc/apache2/orginal.conf /etc/apache2/current.conf
fi
********************************************************
Thanks much,
Y