<?php

require 'header.php';

if ( isset($_REQUEST['show']) && ($_REQUEST['show'] == 'show') ) {
   system("HOME=" . WEBUSERHOMEDIR . " && scripts/homeaudio_togglemute.pl -show", $retval);
} else {
   system("HOME=" . WEBUSERHOMEDIR . " && scripts/homeaudio_togglemute.pl", $retval);
}

$data = array();
if ( $retval == 0 ) {
   $data['muted'] = false;
} else {
   $data['muted'] = true;
}

header('Content-Type: application/json');
echo json_encode($data);
exit();

?>
