You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
<?php
|
|
require_once('/srv/etc/sys_map.php');
|
|
$Data = array();
|
|
$Data['status'] = 0;
|
|
$Data['msg'] = 'Idle';
|
|
$RMD5 = '';
|
|
if( isset( $_POST['IMD'] ) ){
|
|
$RMD5 = $_POST['IMD'];
|
|
} else {
|
|
$RMD5 = $_GET['IMD'];
|
|
};
|
|
if( file_exists( $GVAULT_PATH.'/new_task.var' ) ){
|
|
$Data['status'] = 1;
|
|
$Data['msg'] = 'Task is Pending';
|
|
$Task = json_decode( file_get_contents( $GVAULT_PATH.'/new_task.var' ));
|
|
} elseif( file_exists( $GVAULT_PATH.'/cur_task.var' ) ){
|
|
$Data['msg'] = 'Task is Running';
|
|
$Data['status'] = 2;
|
|
$Task = json_decode( file_get_contents( $GVAULT_PATH.'/cur_task.var' ));
|
|
};
|
|
if( file_exists( $GVAULT_PATH.'/task_log.var' ) ) {
|
|
$TLOG = file_get_contents( $GVAULT_PATH.'/task_log.var' );
|
|
} else {
|
|
$TLOG = '';
|
|
};
|
|
$Data['log_md5'] = md5( $TLOG );
|
|
if( $Data['log_md5'] != $RMD5 ){
|
|
$Data['status_log'] = $TLOG;
|
|
};
|
|
switch( $Data['status'] ){
|
|
case 0:{
|
|
$Data['status_desc'] = 'No Pending Tasks';
|
|
break;
|
|
};
|
|
case 1:{
|
|
$Data['status_desc']=$Task->description;
|
|
break;
|
|
};
|
|
case 2:{
|
|
$Data['status_desc']=$Task->description;
|
|
if( file_exists( $GVAULT_PATH.'/task_perc.var' ) ){
|
|
$ACO = intval( file_get_contents( $GVAULT_PATH.'/task_perc.var' ) );
|
|
} else {
|
|
$ACO = 0;
|
|
};
|
|
break;
|
|
};
|
|
};
|
|
|
|
echo json_encode( $Data );
|
|
|
|
?>
|