aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid/squid.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-30 22:09:20 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-30 22:09:20 +0000
commit5fc28a9d0e98e1821e85e9bba5c669ed7b438a74 (patch)
treedab4eb306b4f40f3ad127d7ed7a070b25fb11f62 /packages/squid/squid.inc
parent24e9a65ee89fd4929b835600f545f4fe87218f8a (diff)
downloadpfsense-packages-5fc28a9d0e98e1821e85e9bba5c669ed7b438a74.tar.gz
pfsense-packages-5fc28a9d0e98e1821e85e9bba5c669ed7b438a74.tar.bz2
pfsense-packages-5fc28a9d0e98e1821e85e9bba5c669ed7b438a74.zip
Ensure file exists before invoking operation on it.
Diffstat (limited to 'packages/squid/squid.inc')
-rw-r--r--packages/squid/squid.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc
index 731992b2..4fbe2c16 100644
--- a/packages/squid/squid.inc
+++ b/packages/squid/squid.inc
@@ -171,8 +171,10 @@ function squid_install_command() {
/* create cache */
squid_dash_z();
/* make sure pinger is executable */
- exec("/bin/chmod a+x /usr/local/libexec/squid/pinger");
- exec("/bin/rm /usr/local/etc/rc.d/squid");
+ if(file_exists("/usr/local/libexec/squid/pinger"))
+ exec("/bin/chmod a+x /usr/local/libexec/squid/pinger");
+ if(file_exists("/usr/local/etc/rc.d/squid"))
+ exec("/bin/rm /usr/local/etc/rc.d/squid");
$rc = array();
$rc['file'] = 'squid.sh';
$rc['start'] = <<<EOD
@@ -854,7 +856,8 @@ function squid_resync() {
squid_resync_users();
/* make sure pinger is executable */
- exec("chmod a+x /usr/local/libexec/squid/pinger");
+ if(file_exists("/usr/local/libexec/squid/pinger"))
+ exec("chmod a+x /usr/local/libexec/squid/pinger");
file_put_contents(SQUID_CONFBASE . '/squid.conf', $conf);