From 48d162d432031250b740dc4555d267d077b2b9c9 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 6 Sep 2013 15:01:05 -0400 Subject: [PATCH] Adding a function to control the daemons (start, stop, etc) --- web/app/Model/AppModel.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/app/Model/AppModel.php b/web/app/Model/AppModel.php index e3ffdede1..d4b5c8057 100644 --- a/web/app/Model/AppModel.php +++ b/web/app/Model/AppModel.php @@ -38,7 +38,16 @@ class AppModel extends Model { $string = $zm_path_bin."/zmdc.pl status"; $daemon_status = shell_exec ( $string ); return $daemon_status; - } + } + + function daemonControl( $command ) { + $string = Configure::read('ZM_PATH_BIN')."/zmdc.pl $command"; + $string .= " 2>/dev/null >&- <&- >/dev/null"; + $return = exec( $string ); + return $return; + } + + public function reScale( $dimension, $dummy) { $scale_base = Configure::read('SCALE_BASE');