From 242b56128b85d2d567c52ac52fdde54a47101144 Mon Sep 17 00:00:00 2001 From: lub Date: Sun, 2 Nov 2014 08:58:40 +0100 Subject: [PATCH] added running as a service instead of cronjob --- cronjob.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cronjob.php b/cronjob.php index 892c6ad..65ed58d 100644 --- a/cronjob.php +++ b/cronjob.php @@ -2,9 +2,11 @@ require_once('config.inc.php'); require_once($framework); -$exceptions = array_unique(array_merge($exceptions, $roots)); +if(__FILE__ != get_included_files()[0]) { + $server = TeamSpeak3::factory('serverquery://'.$user.':'.$passwd.'@'.$host.':'.$queryport.'/?server_port='.$voiceport); +} -$server = TeamSpeak3::factory('serverquery://'.$user.':'.$passwd.'@'.$host.':'.$queryport.'/?server_port='.$voiceport); +$exceptions = array_unique(array_merge($exceptions, $roots)); foreach($roots as $root) { $root = $server->channelGetByName($root);