From 5fc28a9d0e98e1821e85e9bba5c669ed7b438a74 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 30 Apr 2007 22:09:20 +0000 Subject: Ensure file exists before invoking operation on it. --- packages/squid/squid.inc | 9 ++++++--- 1 file 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'] = <<