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
5120905f
Commit
5120905f
authored
Sep 23, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: advertise LiveCD mode and SSH choices
parent
47988b58
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
33 deletions
+47
-33
interfaces.inc
src/etc/inc/interfaces.inc
+18
-0
util.inc
src/etc/inc/util.inc
+18
-0
rc.bootup
src/etc/rc.bootup
+1
-33
guiconfig.inc
src/www/guiconfig.inc
+9
-0
index.php
src/www/index.php
+1
-0
No files found.
src/etc/inc/interfaces.inc
View file @
5120905f
...
...
@@ -5208,3 +5208,21 @@ function get_carp_interface_status($carpinterface)
}
return
;
}
function
is_interface_mismatch
()
{
global
$config
;
if
(
isset
(
$config
[
'interfaces'
]))
{
foreach
(
legacy_config_get_interfaces
(
array
(
"virtual"
=>
false
))
as
$ifname
=>
$ifcfg
)
{
if
(
preg_match
(
"/^enc|^cua|^tun|^tap|^l2tp|^pptp|^ppp|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i"
,
$ifcfg
[
'if'
]))
{
/* Do not check these interfaces */
continue
;
}
elseif
(
does_interface_exist
(
$ifcfg
[
'if'
])
==
false
)
{
return
true
;
}
}
}
return
false
;
}
src/etc/inc/util.inc
View file @
5120905f
...
...
@@ -1559,3 +1559,21 @@ function is_fqdn($fqdn)
return
$hostname
;
}
function
is_install_media
()
{
/*
* Despite unionfs underneath, / is still not writeable,
* making the following the perfect test for install media.
*/
$file
=
'/.probe.for.install.media'
;
$fd
=
@
fopen
(
$file
,
'w'
);
if
(
$fd
)
{
fclose
(
$fd
);
unlink
(
$file
);
return
false
;
}
return
true
;
}
src/etc/rc.bootup
View file @
5120905f
...
...
@@ -29,39 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
function
is_install_media
()
{
/*
* Despite unionfs underneath, / is still not writeable,
* making the following the perfect test for install media.
*/
$file
=
'/.probe.for.install.media'
;
$fd
=
@
fopen
(
$file
,
'w'
);
if
(
$fd
)
{
fclose
(
$fd
);
unlink
(
$file
);
return
false
;
}
return
true
;
}
function
is_interface_mismatch
()
{
global
$config
;
if
(
isset
(
$config
[
'interfaces'
]))
{
foreach
(
legacy_config_get_interfaces
(
array
(
"virtual"
=>
false
))
as
$ifname
=>
$ifcfg
)
{
if
(
preg_match
(
"/^enc|^cua|^tun|^tap|^l2tp|^pptp|^ppp|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i"
,
$ifcfg
[
'if'
]))
{
/* Do not check these interfaces */
continue
;
}
elseif
(
does_interface_exist
(
$ifcfg
[
'if'
])
==
false
)
{
return
true
;
}
}
}
return
false
;
}
/* looks weird, but means we started PHP successfully */
echo
" done.
\n
"
;
echo
"Initializing..."
;
...
...
src/www/guiconfig.inc
View file @
5120905f
...
...
@@ -269,6 +269,15 @@ function print_service_banner($service)
'</a>'
));
break
;
case
'livecd'
:
if
(
!
is_install_media
())
{
break
;
}
print_alert_box
(
gettext
(
'You are currently running in LiveCD mode. A reboot will reset the configuration.'
)
.
' '
.
(
is_process_running
(
'sshd'
)
?
gettext
(
'SSH remote login is enabled for the users "root" and '
.
'"installer" using the same password.'
)
:
gettext
(
'SSH remote login is disabled.'
))
);
default
:
break
;
}
...
...
src/www/index.php
View file @
5120905f
...
...
@@ -310,6 +310,7 @@ include("fbegin.inc");?>
<div
class=
"row"
>
<div
class=
"col-md-12 col-xs-12"
>
<?php
print_service_banner
(
'livecd'
);
$crash_report
=
get_crash_report
();
if
(
$crash_report
!=
''
)
{
print_info_box
(
$crash_report
);
...
...
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