Hello again everyone, another quick question, plus a little script I use that may help others.
The question is, I want to perform redirects to a url that contains the tilde character ( http://somewhere/~someone/blocked.html), unfortunately squidGuard seems to have a problem with this, I've tried breaking it out with a \ character but no joy, and ideas? Thanks Seri Al-Najjar --- Script for Invisible proxy with squidGuard, waits until squidGuard has loaded it's databases --- --- before redirecting --- #!/bin/sh # Define program name pname=squidGuard # Define file to grep location fileloc=/var/log/squidguard/squidGuard.log # Define string to wait for waitfor='squidGuard ready for requests' # Set the status variable to 0, when this becomes 1 the program has initialised # and the script may continue (see later section) status=0 # Insert some white space into the log file so it doesn't see the old results echo "*********************************" >> $fileloc echo "" >> $fileloc echo "$pname starting" >> $fileloc echo "" >> $fileloc echo "*********************************" >> $fileloc #Keep checking for status variable while [ $status -eq 0 ] ; do # Let's see whether we can find the right initialization message result1=`/usr/bin/tail -n 5 $fileloc | grep "$waitfor"` # Uncomment the next line to see the initialisation section (lots of white space) # echo $result1 # if program is initialised, lets run any other commands we want if [ -n "$result1" ] ; then iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 # set status to 1 to break out of the while loop and the script status=1 fi done --- End Script ---
