WBITT

We Bring In Tomorrows Technology

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

SquidGuard Add/remove websites

E-mail Print PDF
User Rating: / 9
PoorBest 

[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
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
You are here How To / Tutorials SquidGuard Add/remove websites