Squid 3.1.10 and FreeBSD 8.2

Greetings to all,

I am new to FreeBSD. I actually installed FreeBSD yesterday and migrated one of my servers (Squid Proxy) and I am facing an issue with a very simple script running with an acl. The same script and acl did work in Linux like a charm. I used Ubuntu Server 11.10 and Slackware 13.37. Anyways, Squid 3.1.10 is rocking but this small glitch.

Every single time the script is being run, I get -->
Code:
2011/10/25 19:59:45| Warning: empty ACL: acl ads dstdom_regex "/usr/local/etc/squid/ad_block.txt"

I have checked all the permissions of the script, ad_block.txt and temp_ad_file. I have chmod 777 and chown to squid user all the files including script. The script functions corrctly but seems to give up when the command [cmd=]squid -k reconfigure[/cmd] is being issued.

I would really appreciate any help of course and if not thank you for taking the time reading my post

Kind Regards,

Here is the acl I am using:

Code:
acl ads dstdom_regex "/etc/squid/ad_block.txt"

Here is the script being used:

Code:
#!/bin/bash
## get new ad server list
/usr/bin/wget -O /tmp/temp_ad_file \
  [url]http://pgl.yoyo.org/adservers/serverlist.php?hostformat=squid-dstdom-regex;showintro=0[/url]

## clean html headers out of list 
cat /tmp/temp_ad_file | grep "(^|" > /etc/squid/ad_block.txt

## refresh squid
/usr/sbin/squid -k reconfigure

## rm temp file
rm -rf /tmp/tmp_ad_file
 
On FreeBSD, bash is a) not the default shell, b) not installed, and c) never an alias for/of sh. Either use the preferred scripting shell /bin/sh, or install bash from ports or from a package (shells/bash), and point to its correct location, i.e. /usr/local/bin/bash. FreeBSD is not a Linux distro, you'll have to be prepared to get used to big differences.
 
DutchDaemon,

Thanks for your reply. I do not know what happened but I posted the Linux script and not the one for FreeBSD which I am using now. I just noticed that after re-reading my post.

Here is the copy I am using. As you said, there is a big difference between Linux and FreeBSD and I did read the manual and modified the script accordingly. I did also installed bash from ports when I installed my system and all is working well but the small error I get with squid acl. Sorry about the mistake.

Code:
## get new ad server list
/usr/local/bin/wget -O /tmp/temp_ad_file \
  [url]http://pgl.yoyo.org/adservers/serverlist.php?hostformat=squid-dstdom-regex;showintro=0[/url]

## clean html headers out of list
cat /tmp/temp_ad_file | grep "(^|" > /usr/local/etc/squid/ad_block.txt

## refresh squid
/usr/local/sbin/squid -k reconfigure

## rm temp file
rm -rf /tmp/tmp_ad_file
 
I'm assuming the script is not actually in /etc/squid? The /etc/ directory belongs to the base system, no ports configurations should be in there. The devil is in the details, check every path in every part of your configuration files and scripts. And please format your posts.
 
Thanks and sorry for the late reply - all is sorted. I have been reading and the learning curve is steep but very interesting.

Kind Regards

zongo
 
Back
Top