A shell script to append MIME Type after a certain pattern

A shell script to append MIME Type after a certain pattern

in the bellow script

a ---> stands for append
\n ---> to next line

#!/bin/bash -x
#script to add mime type

add_mime_type_01 ()
{
echo -e enter domain name
if [ -d /websites/"$1" ]; then
sed -i "/MIME_TYPE_$12631/a\AddType application x-httpd-php .php
\nAddType application x-httpd-php-source .phps"
/usr/local/apache2/conf/extra/httpd_vhost.conf
echo -e " add mime type to $1 "
else
"the domin does not exist or has been deleted "
echo -e "execuiting this command "
fi
}

echo -e "Are you sure you want to add mime type for $1"
read answer
case $answer in
Y|yes|YES ) add_mime_type_01 $1
;;
N|No|NO|n ) echo " you have exited the progam "
;;
* ) echo " please type yes or no "
esac

Now aon you commany line jsut typme

script_command.sh yourdomain.com


--

No comments:

Other Articles

Enter your email address: