/dev/null 2>/dev/null &'); // if($_POST['lan_ip']=="0") // shell_exec('sudo cp /root/interfaces/interfaces_static /etc/network/interfaces'.'> /dev/null 2>/dev/null &'); // else // shell_exec('sudo cp /root/interfaces/interfaces_dhcp /etc/network/interfaces'.'> /dev/null 2>/dev/null &'); // shell_exec('sudo /usr/bin/check_wifi.sh'.'> /dev/null 2>/dev/null &'); //file_put_contents(".tmate.conf", 'set-option -g tmate-webhook-url "http://folus.no-ip.org:8090/tmate_update_payload.php"'."\n".'set-option -g tmate-webhook-userdata "'.$_POST["new_id"].'"'); //shell_exec('sudo mv .tmate.conf /root/'); // shell_exec('sudo /usr/bin/run_apn_set.sh /etc/wvdial.conf '.$_POST['apn_name'].' &'); shell_exec('sync;sync;sync'); //chdir("/home/phihong/Module_WebService"); chdir("/root"); $str_json=json_encode($json);//var_dump($str_json); exec("'./WebService' '2' '".$str_json."'",$output,$return_var); // copy("/var/www/html/system.dat","/home/phihong/Module_WebService/system.txt"); ob_end_clean(); // print_r($output); //echo "OK"; } function checkMaxValue($id){ if($_POST[$id] != ""){ if(!is_numeric($_POST[$id])){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric"; echo json_encode($jsone); exit; } if($_POST[$id]>65535){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a over value on " . $id . ", it should be less than 65535"; echo json_encode($jsone); exit; } if($_POST[$id]<0){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a over value on " . $id . ", it should be more than 0"; echo json_encode($jsone); exit; } } } ?>