Project

General

Profile

Download (2.69 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	reboot.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
9
	All rights reserved.
10

    
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13

    
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16

    
17
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20

    
21
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32

    
33
##|+PRIV
34
##|*IDENT=page-diagnostics-rebootsystem
35
##|*NAME=Diagnostics: Reboot System page
36
##|*DESCR=Allow access to the 'Diagnostics: Reboot System' page.
37
##|*MATCH=reboot.php*
38
##|-PRIV
39

    
40
// Set DEBUG to true to prevent the system_reboot() function from being called
41
define("DEBUG", true);
42

    
43
require("guiconfig.inc");
44
require("functions.inc");
45
require("captiveportal.inc");
46

    
47
$pgtitle = array(gettext("Diagnostics"),gettext("Reboot System"));
48
include("head.inc");
49

    
50

    
51
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
52
?>
53
	<meta http-equiv="refresh" content="70;url=/">
54
	<div class="alert alert-success" role="alert">
55
		<?=gettext("The system is rebooting now. This may take one minute or so.")?>
56
	</div>
57
<?php
58

    
59
	if(DEBUG)
60
	   print("Not actually rebooting (DEBUG is set true)");
61
	else
62
		system_reboot();
63

    
64
} else {
65

    
66

    
67
?>
68

    
69
<div class="panel panel-default">
70
	<div class="panel-heading">Are you sure you want to reboot the system?</div>
71
	<div class="panel-body">Click "Yes" to reboot the system immediately, or "No" to go to the system dashboard without rebooting. (There will be a brief delay before the dashboard appears.)<br /><br />
72
		<form action="reboot.php" method="post">
73
			<input type="submit" class="btn btn-danger pull-center" name="Submit" value="Yes">
74
			<a href="/" class="btn btn-default">No</a>
75
		</form>
76
	</div>
77
</div>
78

    
79
<?php
80

    
81
}
82

    
83
include("foot.inc");
(122-122/241)