-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathscripts.php
85 lines (75 loc) · 3.5 KB
/
scripts.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?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["scripts-fileUpdate"]." " . $filename . "<br /><br />";
}
?>
<div class=content>
<center><?php echo $fileMessage; ?></center>
<div class=contentTitle><?=$strings["scripts-boot-title"]?></div>
<div class=contentContent>
<?php
$fh = fopen("/etc/rc.local", "r") or die("Could not open file!");
$data = fread($fh, filesize("/etc/rc.local")) or die("Could not read file!");
fclose($fh);
echo "<form action='#' method= 'post' >
<textarea name='newdata' rows='20' style='min-width:100%; max-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='/etc/rc.local'>
<br><center><input type='submit' value='".$strings["scripts-boot-button"]."'>
</form>";
?>
</div>
<br /><br />
<div class=contentTitle><?=$strings["scripts-cleanup-title"]?></div>
<div class=contentContent>
<?php
$fh = fopen("scripts/cleanup.sh", "r") or die("Could not open file!");
$data = fread($fh, filesize("scripts/cleanup.sh")) or die("Could not read file!");
fclose($fh);
echo "<form action='#' method= 'post' >
<textarea name='newdata' rows='14' style='min-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='scripts/cleanup.sh'><center><input type='submit' value='".$strings["scripts-cleanup-button"]."'>
</form>";
?>
</div><br /><br />
<div class=contentTitle><?=$strings["scripts-ssh-title"]?></div>
<div class=contentContent>
<?php
$fh = fopen("ssh/ssh-keepalive.sh", "r") or die("Could not open file!");
$data = fread($fh, filesize("ssh/ssh-keepalive.sh")) or die("Could not read file!");
fclose($fh);
echo "<form action='#' method= 'post' >
<textarea name='newdata' rows='14' style='min-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='ssh/ssh-keepalive.sh'><center><input type='submit' value='".$strings["scripts-ssh-button"]."'>
</form>";
?>
</div><br /><br />
<div class=contentTitle><?=$strings["scripts-3g-title"]?></div>
<div class=contentContent>
<?php
$fh = fopen("3g/3g-keepalive.sh", "r") or die("Could not open file!");
$data = fread($fh, filesize("3g/3g-keepalive.sh")) or die("Could not read file!");
fclose($fh);
echo "<form action='#' method= 'post' >
<textarea name='newdata' rows='14' style='min-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='3g/3g-keepalive.sh'><center><input type='submit' value='".$strings["scripts-3g-button"]."'>
</form>";
?>
</div><br /><br />
<div class=contentTitle><?=$strings["scripts-user-title"]?></div>
<div class=contentContent>
<?php
$fh = fopen("scripts/user.sh", "r") or die("Could not open file!");
$data = fread($fh, filesize("scripts/user.sh")) or die("Could not read file!");
fclose($fh);
echo "<form action='#' method= 'post' >
<textarea name='newdata' rows='14' style='min-width:100%; background-color:black; color:white; border-style:dashed;'>$data</textarea>
<input type='hidden' name='filename' value='scripts/user.sh'><center><input type='submit' value='".$strings["scripts-user-button"]."'>
</form>";
?>
</div><br /><br />
</div>