1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
reboot.php
|
5
|
part of m0n0wall (http://m0n0.ch/wall)
|
6
|
|
7
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
8
|
All rights reserved.
|
9
|
|
10
|
Redistribution and use in source and binary forms, with or without
|
11
|
modification, are permitted provided that the following conditions are met:
|
12
|
|
13
|
1. Redistributions of source code must retain the above copyright notice,
|
14
|
this list of conditions and the following disclaimer.
|
15
|
|
16
|
2. Redistributions in binary form must reproduce the above copyright
|
17
|
notice, this list of conditions and the following disclaimer in the
|
18
|
documentation and/or other materials provided with the distribution.
|
19
|
|
20
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
POSSIBILITY OF SUCH DAMAGE.
|
30
|
*/
|
31
|
|
32
|
##|+PRIV
|
33
|
##|*IDENT=page-diagnostics-rebootsystem
|
34
|
##|*NAME=Diagnostics: Reboot System page
|
35
|
##|*DESCR=Allow access to the 'Diagnostics: Reboot System' page.
|
36
|
##|*MATCH=reboot.php*
|
37
|
##|-PRIV
|
38
|
|
39
|
require("guiconfig.inc");
|
40
|
|
41
|
if ($_POST) {
|
42
|
if ($_POST['Submit'] == " Yes ") {
|
43
|
$rebootmsg = "The system is rebooting now. This may take one minute.";
|
44
|
} else {
|
45
|
Header("Location: /");
|
46
|
}
|
47
|
}
|
48
|
|
49
|
$pgtitle = array("Diagnostics","Reboot System");
|
50
|
include("head.inc");
|
51
|
|
52
|
?>
|
53
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
54
|
<?php include("fbegin.inc"); ?>
|
55
|
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
|
56
|
<form action="reboot.php" method="post">
|
57
|
<p><strong>Are you sure you want to reboot the system?</strong></p>
|
58
|
<p>
|
59
|
<input name="Submit" type="submit" class="formbtn" value=" Yes ">
|
60
|
<input name="Submit" type="submit" class="formbtn" value=" No ">
|
61
|
</p>
|
62
|
</form>
|
63
|
<?php endif; ?>
|
64
|
<?php include("fend.inc"); ?>
|
65
|
</body>
|
66
|
</html>
|
67
|
|
68
|
<?php
|
69
|
if ($_POST) {
|
70
|
if ($_POST['Submit'] == " Yes ") {
|
71
|
echo "<meta http-equiv=\"refresh\" content=\"40;url=/\">";
|
72
|
system_reboot();
|
73
|
$rebootmsg = "The system is rebooting now. This may take one minute.";
|
74
|
} else {
|
75
|
exit;
|
76
|
}
|
77
|
}
|
78
|
|
79
|
?>
|