Skip to content

Commit

Permalink
Squid package: Do not attempt to start or monitor squid when squid is…
Browse files Browse the repository at this point in the history
… disabled.

NG #479

(cherry picked from commit 91ba679)
  • Loading branch information
jim-p committed Jan 29, 2018
1 parent 039988d commit 26489ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions www/pfSense-pkg-squid/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-squid
PORTVERSION= 0.4.42
PORTREVISION= 1
PORTVERSION= 0.4.43
CATEGORIES= www
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
6 changes: 6 additions & 0 deletions www/pfSense-pkg-squid/files/usr/local/pkg/sqpmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
# limitations under the License.
#

SQUID_ENABLED=$(/usr/local/sbin/read_xml_tag.sh string installedpackages/squid/config/enable_squid)
if [ "${SQUID_ENABLED}" != "on" ]; then
echo "Squid is disabled, exiting." | /usr/bin/logger -p daemon.info -i -t Squid_Alarm
exit 0
fi

if [ `/bin/pgrep -f "sqpmon.sh" | /usr/bin/wc -l` -ge 1 ]; then
exit 0
fi
Expand Down
5 changes: 4 additions & 1 deletion www/pfSense-pkg-squid/files/usr/local/pkg/squid.inc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ function squid_write_rcfile() {
$rc['file'] = 'squid.sh';
$rc['start'] = <<< EOD
#/sbin/sysctl net.inet.ip.portrange.reservedhigh=0
if [ -z "`/bin/ps auxw | /usr/bin/grep "[s]quid " | /usr/bin/awk '{print $2}'`" ]; then
SQUID_ENABLED=$(/usr/local/sbin/read_xml_tag.sh string installedpackages/squid/config/enable_squid)
if [ "\${SQUID_ENABLED}" != "on" ]; then
exit 0
elif [ -z "`/bin/ps auxw | /usr/bin/grep "[s]quid " | /usr/bin/awk '{print $2}'`" ]; then
{$squid_base}/sbin/squid -f {$squid_conffile_var}
fi
Expand Down

0 comments on commit 26489ae

Please sign in to comment.