Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications


I wrote these script to add or remove websites in SquidGuard. Just copy paste chmod u x .

[root@gateway ~]# vi allowweb.sh
Paste the below mentioned lines.

#!/bin/bash
cd /usr/local/squidGuard/db/whitelist/
echo -n "Plz enter the site name which you want to allow "
read -e web1
echo $web1  >> domains
echo "Enter another web name or press enter "
read -e web2
echo $web2 >> domains
echo "Enter another web name or press enter "
read -e web3
echo $web3 >> domains
echo Plz wait
/usr/local/bin/squidGuard -C domains
service squid restart
echo Web $web1, $web2 $web3 added into whitelist


[root@gateway~]# chmod  u+x allowweb.sh
[root@gateway ~]#./allowweb.sh

---------------------------------------------------------------------------------------

[root@gateway1 ~]# vi delweb.sh
Paste the below mentioned lines.


#!/bin/sh
cd /usr/local/squidGuard/db/whitelist/
echo "Enter the site name which you to delete"

read -e rep
for file in $(grep -il "$rep" domains)
do
sed -e "s/$rep//ig" $file > /tmp/tempfile.tmp
mv /tmp/tempfile.tmp $file
done

echo Plz wait...
/usr/local/bin/squidGuard -C domains
service squid restart
echo Web $rep deleted from whitelist

[root@gateway~]# chmod  u+x delweb.sh

[root@gateway ~]#./delweb.sh
 
Cheers :)

Asim Abbas
asimabbas31@gmail.com
 
Rate This Article: poorexcellent
 
Comments about this article

Comment title: * please do not put your response text here