-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusb.php
More file actions
43 lines (35 loc) · 1.25 KB
/
Copy pathusb.php
File metadata and controls
43 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$filename =$_POST['filename'];
$newdata = $_POST['newdata'];
if ($newdata != "") { $newdata = ereg_replace(13, "", $newdata);
$fw = fopen($filename, 'w') or die('Could not open file!');
$fb = fwrite($fw,stripslashes($newdata)) or die('Could not write to file');
fclose($fw);
$fileMessage = $strings["usb-fileUpdate"]." " . $filename . "<br /><br />";
} ?>
<div class=content>
<center><?php echo $fileMessage; ?></center>
<div class="contentTitle"><?=$strings["usb-lsusb"]?></div>
<div class="contentContent">
<?php
$exec = exec("lsusb", $return);
foreach ($return as $line) {
echo("$line <br />");
}
?>
</div><br /><br />
<div class="contentTitle"><?=$strings["usb-fstab"]?></div>
<div class="contentContent">
<?php
$filename = "/etc/config/fstab";
$fh = fopen($filename, "r") or die("Could not open file!");
$data = fread($fh, filesize($filename)) or die("Could not read file!");
fclose($fh);
echo "<br />
<form action='$_SERVER[php_self]' method= 'post' >
<textarea name='newdata' rows='20' style='min-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='/etc/config/fstab'>
<br><center><input type='submit' value='".$strings["usb-fstab-button"]."'>
</form>"; ?>
</div>
</div>