Skip to content

Commit

Permalink
fix #479 the status shown that playSMS Daemon is not running although…
Browse files Browse the repository at this point in the history
… IT IS running
  • Loading branch information
antonraharja committed Aug 22, 2015
1 parent 46408f7 commit 432c557
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
8 changes: 6 additions & 2 deletions web/plugin/feature/playsmslog/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

if (auth_isadmin()) {
$menutab = $core_config['menutab']['reports'];
$menu_config[$menutab][] = array("index.php?app=main&inc=feature_playsmslog&op=playsmslog_list", _('View log'));
$menu_config[$menutab][] = array(
"index.php?app=main&inc=feature_playsmslog&op=playsmslog_list",
_('View log')
);
}

$plugin_config['playsmsd']['bin'] = '/usr/local/bin/playsmsd';
$plugin_config['playsmslog']['playsmsd']['bin'] = '/usr/local/bin/playsmsd';
$plugin_config['playsmslog']['playsmsd']['conf'] = '/etc/playsmsd.conf';
23 changes: 19 additions & 4 deletions web/plugin/feature/playsmslog/fn.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
<?php

/**
* This file is part of playSMS.
*
* playSMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* playSMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with playSMS. If not, see <http://www.gnu.org/licenses/>.
*/
defined('_SECURE_') or die('Forbidden');

function playsmslog_view($nline=1000) {
function playsmslog_view($nline = 1000) {
global $core_config;
$content = @shell_exec('tail -n '.$nline.' '.$core_config['apps_path']['logs'].'/playsms.log');
$content = @shell_exec('tail -n ' . $nline . ' ' . $core_config['apps_path']['logs'] . '/playsms.log');
return $content;
}

?>
2 changes: 1 addition & 1 deletion web/plugin/feature/playsmslog/playsmslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
case "playsmslog_log":

// get playsmsd status
$json = shell_exec($plugin_config['playsmsd']['bin'] . ' check_json');
$json = shell_exec($plugin_config['playsmslog']['playsmsd']['bin'] . ' ' . $plugin_config['playsmslog']['playsmsd']['conf'] . ' check_json');
$playsmsd = json_decode($json);
if ($playsmsd->IS_RUNNING) {
$playsmsd_is_running = '<span class=status_enabled title="' . _('playSMS daemon is running') . '"></span>';
Expand Down

0 comments on commit 432c557

Please sign in to comment.