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
d440d59a
Commit
d440d59a
authored
Jul 22, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) move get_ppp_uptime to interfaces.inc
parent
63147c32
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
50 deletions
+19
-50
functions.inc
src/etc/inc/functions.inc
+0
-32
interfaces.inc
src/etc/inc/interfaces.inc
+19
-0
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-18
No files found.
src/etc/inc/functions.inc
deleted
100644 → 0
View file @
63147c32
<?php
/*
Copyright (C) 2004-2006 Scott Ullrich
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/* include all configuration functions */
require_once
(
"interfaces.inc"
);
require_once
(
"services.inc"
);
src/etc/inc/interfaces.inc
View file @
d440d59a
...
...
@@ -5418,3 +5418,22 @@ function zte_simstate_to_string($state) {
$string
=
"
{
$modes
[
$state
]
}
State"
;
return
$string
;
}
/* Compute the total uptime from the ppp uptime log file in the conf directory */
function
get_ppp_uptime
(
$port
){
if
(
file_exists
(
"/conf/
{
$port
}
.log"
)){
$saved_time
=
file_get_contents
(
"/conf/
{
$port
}
.log"
);
$uptime_data
=
explode
(
"
\n
"
,
$saved_time
);
$sec
=
0
;
foreach
(
$uptime_data
as
$upt
)
{
$sec
+=
substr
(
$upt
,
1
+
strpos
(
$upt
,
" "
));
}
return
convert_seconds_to_hms
(
$sec
);
}
else
{
$total_time
=
gettext
(
"No history data found!"
);
return
$total_time
;
}
}
src/etc/inc/pfsense-utils.inc
View file @
d440d59a
...
...
@@ -435,24 +435,6 @@ function is_pppoe_server_enabled() {
return
$pppoeenable
;
}
/* Compute the total uptime from the ppp uptime log file in the conf directory */
function
get_ppp_uptime
(
$port
){
if
(
file_exists
(
"/conf/
{
$port
}
.log"
)){
$saved_time
=
file_get_contents
(
"/conf/
{
$port
}
.log"
);
$uptime_data
=
explode
(
"
\n
"
,
$saved_time
);
$sec
=
0
;
foreach
(
$uptime_data
as
$upt
)
{
$sec
+=
substr
(
$upt
,
1
+
strpos
(
$upt
,
" "
));
}
return
convert_seconds_to_hms
(
$sec
);
}
else
{
$total_time
=
gettext
(
"No history data found!"
);
return
$total_time
;
}
}
function
add_hostname_to_watch
(
$hostname
)
{
if
(
!
is_dir
(
"/var/db/dnscache"
))
{
mkdir
(
"/var/db/dnscache"
);
...
...
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