added a sudoers file; refined handling of success/error
This commit is contained in:
parent
b933ad4fc9
commit
970c5e1df6
2
conf/restarter
Normal file
2
conf/restarter
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# sudoers entry for package restarter
|
||||||
|
www-data unterdemradar=NOPASSWD: /usr/bin/systemctl restart minidlna.service
|
||||||
@ -20,8 +20,8 @@ console.log(query);
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<!-- <button type=button onClick="restart('sudo systemctl restart minidlna.service')">MiniDLNA</button> -->
|
||||||
<button type=button onClick="restart('ls -al')">MiniDLNA</button>
|
<button type=button onClick="restart('ls -al')">MiniDLNA</button>
|
||||||
<!-- PHP built-in web server: php -S [IP]:[port] -t [path]</pre></p> -->
|
|
||||||
<div id="result">
|
<div id="result">
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -14,6 +14,10 @@
|
|||||||
}
|
}
|
||||||
// execute shell command
|
// execute shell command
|
||||||
exec($command, $output, $exitcode);
|
exec($command, $output, $exitcode);
|
||||||
echo "Output is <pre>", join("<br>", $output), "</pre><br>";
|
echo "Output is <pre>", join("<br>", $output), "</pre><br>";//DEBUG
|
||||||
echo "Exit code is ", $exitcode;
|
if ( $exitcode == "0" ) {
|
||||||
|
echo "Success";
|
||||||
|
} else {
|
||||||
|
echo "Command failed with exit code", $exitcode;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user