I have a script I am trying to run that will remove lines from an apache configuration file for a particular domain. The lines are added via another script and it works fine and is added in the exact format I am trying to remove. I must have the sed expression screwed up or something because it just prints the whole config file again without removing the lines I want.
The script is executed like so:
./script.sh domain.com aliasdomain.com
Here is the script:
echo -e "Removing http/web forwarding for $DOMAIN\n\n";
# Setup the /etc conf file
echo -e "Clearing the /etc config file.\n";
etc_conf="<VirtualHost x.x.x.x:80>\n\tServerName $DOMAIN\n\tServerAlias $FQDOMAIN\n\tRedirect Permanent / \"http://www.$ALIASDOMAIN/\
echo -e $etc_conf;
sed -e s_"$etc_conf"_""_g $etc_conf_file > $etc_conf_file.tmp
Any help would be much appreciated.