aboutsummaryrefslogtreecommitdiffstats
path: root/config/shellcmd/shellcmd.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-10 12:48:58 +0000
committerErmal <eri@pfsense.org>2010-12-10 12:48:58 +0000
commit9a77cafd7e400640a855f8f5112dd59c93af92a7 (patch)
treeaa2ee03075b503a42890763f82aa2593a64fca8a /config/shellcmd/shellcmd.inc
parent806db0240fa060b9ceb197fbc636be8bf916d95c (diff)
downloadpfsense-packages-9a77cafd7e400640a855f8f5112dd59c93af92a7.tar.gz
pfsense-packages-9a77cafd7e400640a855f8f5112dd59c93af92a7.tar.bz2
pfsense-packages-9a77cafd7e400640a855f8f5112dd59c93af92a7.zip
Fix all this packages from their copy/paste legacy. Mostly protect poorly choosen function names with function_exists.
Diffstat (limited to 'config/shellcmd/shellcmd.inc')
-rw-r--r--config/shellcmd/shellcmd.inc34
1 files changed, 18 insertions, 16 deletions
diff --git a/config/shellcmd/shellcmd.inc b/config/shellcmd/shellcmd.inc
index 4d9a82ca..c7f50202 100644
--- a/config/shellcmd/shellcmd.inc
+++ b/config/shellcmd/shellcmd.inc
@@ -31,21 +31,23 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-require("services.inc");
-
-function pkg_is_service_running($servicename)
-{
- exec("/bin/ps ax | awk '{ print $5 }'", $psout);
- array_shift($psout);
- foreach($psout as $line) {
- $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
- }
- if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
- return true;
- }
- else {
- return false;
- }
+require_once("services.inc");
+
+if (!function_exists("pkg_is_service_running")) {
+ function pkg_is_service_running($servicename)
+ {
+ exec("/bin/ps ax | awk '{ print $5 }'", $psout);
+ array_shift($psout);
+ foreach($psout as $line) {
+ $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
+ }
+ if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
}
function shellcmd_sync_package()
@@ -118,4 +120,4 @@ function shellcmd_deinstall_command()
}
-?> \ No newline at end of file
+?>