Added "USB backup" function

This commit is contained in:
bergware
2017-07-14 01:51:39 +02:00
parent 6e82e2cc40
commit 8bcb70cffc
3 changed files with 84 additions and 3 deletions
+10 -2
View File
@@ -11,7 +11,7 @@
*/
?>
<?
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
$docroot = $docroot ?: $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
$file = $_POST['file'];
switch ($_POST['cmd']) {
case 'save':
@@ -36,5 +36,13 @@ case 'diag':
exec("$docroot/webGui/scripts/diagnostics $anon ".escapeshellarg("$docroot/$file"));
echo "/$file";
break;
}
case 'unlink':
$disk = exec("ls -l '$docroot/$file'");
$disk = substr($disk,strpos($disk,'>')+2);
exec("rm -f '$docroot/$file' '$disk'");
break;
case 'backup':
echo exec("$docroot/webGui/scripts/usb_backup");
break;
}
?>