Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
25a6aa6b
Commit
25a6aa6b
authored
Apr 24, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: change halt to power off; closes #907
parent
dc44d88d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
rc.initial
src/etc/rc.initial
+1
-1
Menu.xml
src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml
+1
-1
diag_halt.php
src/www/diag_halt.php
+3
-4
No files found.
src/etc/rc.initial
View file @
25a6aa6b
...
@@ -40,7 +40,7 @@ echo " 1) Assign Interfaces 8) Shell"
...
@@ -40,7 +40,7 @@ echo " 1) Assign Interfaces 8) Shell"
echo
" 2) Set interface(s) IP address 9) pfTop"
echo
" 2) Set interface(s) IP address 9) pfTop"
echo
" 3) Reset the root password 10) Filter Logs"
echo
" 3) Reset the root password 10) Filter Logs"
echo
" 4) Reset to factory defaults 11) Restart web interface"
echo
" 4) Reset to factory defaults 11) Restart web interface"
echo
" 5)
Halt system
12) Upgrade from console"
echo
" 5)
Power off system
12) Upgrade from console"
echo
" 6) Reboot system 13) Restore a configuration"
echo
" 6) Reboot system 13) Restore a configuration"
if
[
-n
"
${
option99
}
"
]
;
then
if
[
-n
"
${
option99
}
"
]
;
then
# flat for alignment...
# flat for alignment...
...
...
src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml
View file @
25a6aa6b
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
<Updates
order=
"10"
url=
"/ui/core/firmware/"
/>
<Updates
order=
"10"
url=
"/ui/core/firmware/"
/>
<Reporter
order=
"20"
url=
"/crash_reporter.php"
/>
<Reporter
order=
"20"
url=
"/crash_reporter.php"
/>
<Reboot
order=
"30"
url=
"/reboot.php"
/>
<Reboot
order=
"30"
url=
"/reboot.php"
/>
<
Halt
order=
"40"
url=
"/diag_halt.php"
/>
<
PowerOff
VisibleName=
"Power Off"
order=
"40"
url=
"/diag_halt.php"
/>
<Defaults
order=
"50"
url=
"/diag_defaults.php"
/>
<Defaults
order=
"50"
url=
"/diag_defaults.php"
/>
</Firmware>
</Firmware>
<HighAvailability
order=
"50"
VisibleName=
"High Availability"
cssClass=
"fa fa-refresh fa-fw"
>
<HighAvailability
order=
"50"
VisibleName=
"High Availability"
cssClass=
"fa fa-refresh fa-fw"
>
...
...
src/www/diag_halt.php
View file @
25a6aa6b
...
@@ -43,11 +43,11 @@ include('head.inc');
...
@@ -43,11 +43,11 @@ include('head.inc');
<section
class=
"col-xs-12"
>
<section
class=
"col-xs-12"
>
<?php
<?php
if
(
!
empty
(
$_POST
[
'Submit'
]))
:
if
(
!
empty
(
$_POST
[
'Submit'
]))
:
print_info_box
(
gettext
(
"The system is
halting now. This may take one minute
."
));
?>
print_info_box
(
gettext
(
"The system is
powering off now
."
));
?>
<?php
<?php
else
:
?>
else
:
?>
<form
method=
"post"
>
<form
method=
"post"
>
<p><strong>
<?=
gettext
(
"Are you sure you want to
halt
the system?"
);
?>
</strong></p>
<p><strong>
<?=
gettext
(
"Are you sure you want to
power off
the system?"
);
?>
</strong></p>
<div
class=
"btn-group"
>
<div
class=
"btn-group"
>
<input
type=
"submit"
name=
"Submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Yes"
);
?>
"
/>
<input
type=
"submit"
name=
"Submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Yes"
);
?>
"
/>
<a
href=
"/"
class=
"btn btn-default"
>
<?=
gettext
(
"No"
);
?>
</a>
<a
href=
"/"
class=
"btn btn-default"
>
<?=
gettext
(
"No"
);
?>
</a>
...
@@ -61,10 +61,9 @@ include('head.inc');
...
@@ -61,10 +61,9 @@ include('head.inc');
</section>
</section>
<?php
include
(
"foot.inc"
);
<?php
include
(
"foot.inc"
);
// system halt, when submit pressed
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
if
(
!
empty
(
$_POST
[
'Submit'
]))
{
if
(
!
empty
(
$_POST
[
'Submit'
]))
{
system_halt
();
system_halt
();
}
}
}
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment