Try this:
<?php
$items['googledotcom'] = array
(
'description'=>'DNS resolution test',
'1'=>1,
'0'=>0,
'fixCommand'=>"EXC service network restart; echo 'nameserver 8.8.8.8' >> /etc/resolv.conf; sleep 10; curo health check"
);
var_dump($items);
?>
This shows:
array(1) { ["googledotcom"]=> array(4) { ["description"]=> string(19) "DNS resolution test" [1]=> int(1) [0]=> int(0) ["fixCommand"]=> string(103) "EXC service network restart; echo 'nameserver 8.8.8.8' >> /etc/resolv.conf; sleep 10; curo health check" } }
Now i test the value with the following fiddle and it's working: http://jsfiddle.net/EjXmp/
That fiddle contains the following code:
$(document).ready(function(){
$("#clickme").click(function(){
doCommand("EXC service network restart; echo 'nameserver 8.8.8.8' >> /etc/resolv.conf; sleep 10; curo health check");
});
function doCommand(command)
{
var r=confirm("Are you sure you want to \"" + command + "\"");
if (!r)
{
return;
}
$.post('/device/commands-frame/', { id : '<?=$this->site->id;?>', act : command, command : command }, function(data)
{
alert('Command has been sent');
});
}
});