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
a47ad5e7
Commit
a47ad5e7
authored
Mar 06, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: prune, prettify or zap scripts that use PHP shebang
parent
cabdbf8c
Changes
54
Hide whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
175 additions
and
504 deletions
+175
-504
3gstats.php
src/bin/3gstats.php
+1
-1
captiveportal_gather_stats.php
src/bin/captiveportal_gather_stats.php
+2
-5
easyrule
src/bin/easyrule
+0
-123
filterparser.php
src/bin/filterparser.php
+0
-57
mail.php
src/bin/mail.php
+0
-24
ipsec.auth-user.php
src/etc/inc/ipsec.auth-user.php
+1
-3
openvpn.auth-user.php
src/etc/inc/openvpn.auth-user.php
+1
-1
openvpn.tls-verify.php
src/etc/inc/openvpn.tls-verify.php
+1
-3
rc.bootup
src/etc/rc.bootup
+1
-1
rc.carpbackup
src/etc/rc.carpbackup
+2
-4
rc.carpmaster
src/etc/rc.carpmaster
+2
-4
rc.conf_mount_ro
src/etc/rc.conf_mount_ro
+1
-2
rc.conf_mount_rw
src/etc/rc.conf_mount_rw
+1
-2
rc.dyndns.update
src/etc/rc.dyndns.update
+1
-2
rc.expireaccounts
src/etc/rc.expireaccounts
+34
-37
rc.filter_configure_sync
src/etc/rc.filter_configure_sync
+1
-2
rc.filter_configure_xmlrpc
src/etc/rc.filter_configure_xmlrpc
+5
-10
rc.filter_synchronize
src/etc/rc.filter_synchronize
+1
-3
rc.initial.banner
src/etc/rc.initial.banner
+1
-1
rc.initial.defaults
src/etc/rc.initial.defaults
+14
-18
rc.initial.halt
src/etc/rc.initial.halt
+1
-1
rc.initial.password
src/etc/rc.initial.password
+1
-1
rc.initial.ping
src/etc/rc.initial.ping
+23
-26
rc.initial.reboot
src/etc/rc.initial.reboot
+1
-1
rc.initial.setlanip
src/etc/rc.initial.setlanip
+1
-9
rc.initial.setports
src/etc/rc.initial.setports
+15
-22
rc.interfaces_wan_configure
src/etc/rc.interfaces_wan_configure
+1
-2
rc.kill_states
src/etc/rc.kill_states
+2
-3
rc.linkup
src/etc/rc.linkup
+17
-21
rc.newipsecdns
src/etc/rc.newipsecdns
+1
-2
rc.newroutedns
src/etc/rc.newroutedns
+1
-2
rc.newwanip
src/etc/rc.newwanip
+2
-4
rc.newwanipv6
src/etc/rc.newwanipv6
+3
-8
rc.openvpn
src/etc/rc.openvpn
+1
-3
rc.php_test_run
src/etc/rc.php_test_run
+2
-2
rc.prunecaptiveportal
src/etc/rc.prunecaptiveportal
+1
-1
rc.reload_all
src/etc/rc.reload_all
+1
-2
rc.reload_interfaces
src/etc/rc.reload_interfaces
+1
-2
rc.resolv_conf_generate
src/etc/rc.resolv_conf_generate
+2
-3
rc.restart_webgui
src/etc/rc.restart_webgui
+1
-1
rc.restore_config_backup
src/etc/rc.restore_config_backup
+2
-3
rc.savevoucher
src/etc/rc.savevoucher
+9
-12
rc.sshd
src/etc/rc.sshd
+1
-1
rc.start_packages
src/etc/rc.start_packages
+1
-3
rc.stop_packages
src/etc/rc.stop_packages
+3
-2
rc.update_alias_url_data
src/etc/rc.update_alias_url_data
+2
-9
rc.update_urltables
src/etc/rc.update_urltables
+1
-2
configd_ctl.py
src/opnsense/service/configd_ctl.py
+0
-6
execute_command.py
src/opnsense/service/execute_command.py
+0
-3
gmirror_status_check.php
src/sbin/gmirror_status_check.php
+2
-10
show_filter_reload_status.php
src/sbin/show_filter_reload_status.php
+0
-26
diag_logs_vpn.php
src/www/diag_logs_vpn.php
+1
-1
status_queues.php
src/www/status_queues.php
+3
-3
uploadconfig.php
src/www/uploadconfig.php
+2
-4
No files found.
src/bin/3gstats.php
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
ini_set
(
"max_execution_time"
,
"0"
);
...
...
src/bin/captiveportal_gather_stats.php
View file @
a47ad5e7
#!/usr/local/bin/php
-q
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
captiveportal_gather_stats.php
Copyright (C) 2011 Warren Baker
All rights reserved.
...
...
@@ -108,5 +107,3 @@ if ($type == "loggedin") {
$result
=
$no_users
;
echo
"
$result
"
;
?>
src/bin/easyrule
deleted
100755 → 0
View file @
cabdbf8c
#!/usr/local/bin/php -q
<?php
/*
easyrule CLI Program
Copyright (C) 2010 Jim Pingle (jpingle@gmail.com)
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.
*/
require_once
(
"pfsense-utils.inc"
);
require_once
(
"easyrule.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
$message
=
""
;
$specialsrcdst
=
explode
(
" "
,
"any pptp pppoe l2tp openvpn"
);
$ifdisp
=
get_configured_interface_with_descr
();
foreach
(
$ifdisp
as
$kif
=>
$kdescr
)
{
$specialsrcdst
[]
=
"
{
$kif
}
"
;
$specialsrcdst
[]
=
"
{
$kif
}
ip"
;
}
/* Borrow this function from guiconfig.inc since we can't include it for use at the CLI
- Maybe these need to be moved to util.inc or pfsense-utils.inc?
*/
function
pconfig_to_address
(
&
$adr
,
$padr
,
$pmask
,
$pnot
=
false
,
$pbeginport
=
0
,
$pendport
=
0
)
{
$adr
=
array
();
if
(
$padr
==
"any"
)
$adr
[
'any'
]
=
true
;
else
if
(
is_specialnet
(
$padr
))
$adr
[
'network'
]
=
$padr
;
else
{
$adr
[
'address'
]
=
$padr
;
if
(
$pmask
!=
32
)
$adr
[
'address'
]
.=
"/"
.
$pmask
;
}
if
(
$pnot
)
$adr
[
'not'
]
=
true
;
else
unset
(
$adr
[
'not'
]);
if
((
$pbeginport
!=
0
)
&&
(
$pbeginport
!=
"any"
))
{
if
(
$pbeginport
!=
$pendport
)
$adr
[
'port'
]
=
$pbeginport
.
"-"
.
$pendport
;
else
$adr
[
'port'
]
=
$pbeginport
;
}
if
(
is_alias
(
$pbeginport
))
{
$adr
[
'port'
]
=
$pbeginport
;
}
}
/* Borrow this one from guiconfig.inc also */
function
is_specialnet
(
$net
)
{
global
$specialsrcdst
;
if
(
!
$net
)
return
false
;
if
(
in_array
(
$net
,
$specialsrcdst
))
return
true
;
else
return
false
;
}
if
((
$argc
>
1
)
&&
!
empty
(
$argv
[
1
]))
{
$message
=
""
;
switch
(
$argv
[
1
])
{
case
'block'
:
$message
=
easyrule_parse_block
(
$argv
[
2
],
$argv
[
3
]);
break
;
case
'pass'
:
$message
=
easyrule_parse_pass
(
$argv
[
2
],
$argv
[
3
],
$argv
[
4
],
$argv
[
5
],
$argv
[
6
]);
break
;
}
echo
$message
.
"
\n
"
;
}
else
{
// Print usage:
echo
"usage:
\n
"
;
echo
" Blocking only requires an IP to block
\n
"
;
echo
" "
.
basename
(
$argv
[
0
])
.
" block <interface> <source IP>
\n
"
;
echo
"
\n
"
;
echo
" Passing requires more detail, as it must be as specific as possible. The destination port is optional if you're using a protocol without a port (e.g. ICMP, OSPF, etc).
\n
"
;
echo
" "
.
basename
(
$argv
[
0
])
.
" pass <interface> <protocol> <source IP> <destination ip> [destination port]
\n
"
;
echo
"
\n
"
;
echo
" Block example:
\n
"
;
echo
" "
.
basename
(
$argv
[
0
])
.
" block wan 1.2.3.4
\n
"
;
echo
"
\n
"
;
echo
" Pass example (protocol with port):
\n
"
;
echo
" "
.
basename
(
$argv
[
0
])
.
" pass wan tcp 1.2.3.4 192.168.0.4 80
\n
"
;
echo
"
\n
"
;
echo
" Pass example (protocol without port):
\n
"
;
echo
" "
.
basename
(
$argv
[
0
])
.
" pass wan icmp 1.2.3.4 192.168.0.4
\n
"
;
echo
"
\n
"
;
}
?>
src/bin/filterparser.php
deleted
100755 → 0
View file @
cabdbf8c
#!/usr/local/bin/php -q
<?php
/* $Id$ */
/*
filterparser.php
part of pfSesne by Scott Ullrich
originally based on m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2009 Jim Pingle <myfirstname>@<mylastname>.org
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.
A quick CLI log parser.
Examples:
clog /var/log/filter.log | tail -50 | /usr/local/www/filterparser.php
clog -f /var/log/filter.log | /usr/local/www/filterparser.php
*/
/*
pfSense_MODULE: logs
*/
include_once
(
"functions.inc"
);
include_once
(
"filter_log.inc"
);
$log
=
fopen
(
"php://stdin"
,
"r"
);
$lastline
=
""
;
while
(
!
feof
(
$log
))
{
$line
=
fgets
(
$log
);
$line
=
rtrim
(
$line
);
$flent
=
parse_filter_line
(
trim
(
$line
));
if
(
$flent
!=
""
)
{
$flags
=
((
$flent
[
'proto'
]
==
"TCP"
)
&&
!
empty
(
$flent
[
'tcpflags'
]))
?
":"
.
$flent
[
'tcpflags'
]
:
""
;
echo
"
{
$flent
[
'time'
]
}
{
$flent
[
'act'
]
}
{
$flent
[
'realint'
]
}
{
$flent
[
'proto'
]
}{
$flags
}
{
$flent
[
'src'
]
}
{
$flent
[
'dst'
]
}
\n
"
;
$flent
=
""
;
}
}
fclose
(
$log
);
?>
src/bin/mail.php
deleted
100755 → 0
View file @
cabdbf8c
#!/usr/local/bin/php -q
<?php
require_once
(
"config.inc"
);
require_once
(
"globals.inc"
);
require_once
(
"notices.inc"
);
$options
=
getopt
(
"s::"
);
$message
=
""
;
if
(
$options
[
's'
]
<>
""
)
{
$subject
=
$options
[
's'
];
}
$in
=
file
(
"php://stdin"
);
foreach
(
$in
as
$line
){
$message
.=
"
$line
"
;
}
if
(
!
empty
(
$subject
))
send_smtp_message
(
$message
,
$subject
);
else
send_smtp_message
(
$message
);
?>
src/etc/inc/ipsec.auth-user.php
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -155,5 +155,3 @@ if (isset($_GET['username']))
echo
"OK"
;
else
exit
(
0
);
?>
src/etc/inc/openvpn.auth-user.php
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/inc/openvpn.tls-verify.php
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -68,5 +68,3 @@ if (isset($allowed_depth) && ($cert_depth > $allowed_depth)) {
closelog
();
exit
(
0
);
?>
src/etc/rc.bootup
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.carpbackup
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
rc.carpdown
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.carpmaster
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
rc.carpup
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.conf_mount_ro
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.conf_mount_rw
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.dyndns.update
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.expireaccounts
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
rc.exireaccounts
part of pfSense
/*
Copyright (C) 2009 Shrew Soft Inc.
All rights reserved.
...
...
@@ -30,37 +27,37 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
$removed
=
0
;
if
(
!
is_array
(
$config
[
'system'
][
'user'
]))
return
;
$count
=
count
(
$config
[
'system'
][
'user'
]);
$index
=
0
;
for
(;
$index
<
$count
;
$index
++
)
{
$user
=&
$config
[
'system'
][
'user'
][
$index
];
if
(
$user
[
'scope'
]
==
"system"
)
continue
;
echo
"1
\n
"
;
echo
"User
{
$user
[
'name'
]
}
expires
{
$user
[
'expires'
]
}
\n
"
;
if
(
!
$user
[
'expires'
]
||
isset
(
$user
[
'disabled'
]))
continue
;
echo
"1
\n
"
;
if
(
strtotime
(
"-1 day"
)
>
strtotime
(
$user
[
'expires'
]))
{
echo
"Disabling user
{
$user
[
'name'
]
}
at index #
{
$index
}
\n
"
;
//unset($config['system']['user'][$index]);
$user
[
'disabled'
]
=
true
;
$removed
++
;
$count
--
;
$index
--
;
}
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
$removed
=
0
;
if
(
!
is_array
(
$config
[
'system'
][
'user'
]))
{
return
;
}
$count
=
count
(
$config
[
'system'
][
'user'
]);
$index
=
0
;
for
(;
$index
<
$count
;
$index
++
)
{
$user
=&
$config
[
'system'
][
'user'
][
$index
];
if
(
$user
[
'scope'
]
==
"system"
)
continue
;
echo
"1
\n
"
;
echo
"User
{
$user
[
'name'
]
}
expires
{
$user
[
'expires'
]
}
\n
"
;
if
(
!
$user
[
'expires'
]
||
isset
(
$user
[
'disabled'
]))
continue
;
echo
"1
\n
"
;
if
(
strtotime
(
"-1 day"
)
>
strtotime
(
$user
[
'expires'
]))
{
echo
"Disabling user
{
$user
[
'name'
]
}
at index #
{
$index
}
\n
"
;
//unset($config['system']['user'][$index]);
$user
[
'disabled'
]
=
true
;
$removed
++
;
$count
--
;
$index
--
;
}
}
if
(
$removed
>
0
)
write_config
(
"Expired
{
$removed
}
user accounts"
);
//print_r($config);
?>
if
(
$removed
>
0
)
{
write_config
(
"Expired
{
$removed
}
user accounts"
);
}
src/etc/rc.filter_configure_sync
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.filter_configure_xmlrpc
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2004-2006 Scott Ullrich
Copyright (C) 2005 Bill Marquette
Copyright (C) 2006 Peter Allgeyer
Copyright (C) 2008 Ermal Luci
All rights reserved.
originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2005 Bill Marquette
Copyright (C) 2006 Peter Allgeyer
Copyright (C) 2008 Ermal Luci
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -42,12 +39,10 @@ require_once("filter.inc");
require_once
(
"shaper.inc"
);
require_once
(
"xmlrpc.inc"
);
require_once
(
"interfaces.inc"
);
require_once
(
"openvpn.inc"
);
system_routing_configure
();
setup_gateways_monitor
();
relayd_configure
();
require_once
(
"openvpn.inc"
);
openvpn_resync_all
();
services_dhcpd_configure
();
?>
src/etc/rc.filter_synchronize
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -432,5 +432,3 @@ if (is_array($config['hasync'])) {
$numberofruns
=
3
;
}
}
?>
src/etc/rc.initial.banner
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.initial.defaults
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
rc.initial.defaults
part of m0n0wall (http://m0n0.ch/wall)
/*
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -30,14 +27,14 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
require_once
(
"util.inc"
);
require_once
(
"config.lib.inc"
);
require_once
(
"functions.inc"
);
/* parse the configuration and include all functions used below */
require_once
(
"util.inc"
);
require_once
(
"config.lib.inc"
);
require_once
(
"functions.inc"
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
echo
<<<EOD
echo
<<<EOD
You are about to reset the firewall to factory defaults.
The firewall will reboot after resetting the configuration.
...
...
@@ -45,18 +42,17 @@ The firewall will reboot after resetting the configuration.
Do you want to proceed [y|n]?
EOD;
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
"y"
)
==
0
)
{
if
(
strcasecmp
(
chop
(
fgets
(
$fp
)),
"y"
)
==
0
)
{
reset_factory_defaults
();
reset_factory_defaults
();
echo
<<<EOD
echo
<<<EOD
{$g['product_name']} is rebooting now.
EOD;
system_reboot_sync
();
}
system_reboot_sync
();
}
fclose
(
$fp
);
?>
fclose
(
$fp
);
src/etc/rc.initial.halt
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.initial.password
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.initial.ping
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -29,26 +27,25 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
echo
"
\n
Enter a host name or IP address: "
;
$pinghost
=
chop
(
fgets
(
$fp
));
if
(
is_ipaddrv4
(
$pinghost
)
||
is_hostname
(
$pinghost
))
{
$command
=
"ping"
;
}
elseif
(
is_ipaddrv6
(
$pinghost
))
{
$command
=
"ping6"
;
}
if
(
$command
)
{
echo
"
\n
"
;
passthru
(
"/sbin/
{
$command
}
-c 3 -n "
.
escapeshellarg
(
$pinghost
));
echo
"
\n
Press ENTER to continue.
\n
"
;
fgets
(
$fp
);
}
fclose
(
$fp
);
?>
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
$fp
=
fopen
(
'php://stdin'
,
'r'
);
echo
"
\n
Enter a host name or IP address: "
;
$pinghost
=
chop
(
fgets
(
$fp
));
if
(
is_ipaddrv4
(
$pinghost
)
||
is_hostname
(
$pinghost
))
{
$command
=
"ping"
;
}
elseif
(
is_ipaddrv6
(
$pinghost
))
{
$command
=
"ping6"
;
}
if
(
$command
)
{
echo
"
\n
"
;
passthru
(
"/sbin/
{
$command
}
-c 3 -n "
.
escapeshellarg
(
$pinghost
));
echo
"
\n
Press ENTER to continue.
\n
"
;
fgets
(
$fp
);
}
fclose
(
$fp
);
src/etc/rc.initial.reboot
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.initial.setlanip
View file @
a47ad5e7
#!/usr/local/bin/php
-q
#!/usr/local/bin/php
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -29,8 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
$options
=
getopt
(
"hn"
,
array
(
"dry-run"
,
"help"
));
if
(
isset
(
$options
[
"h"
])
||
isset
(
$options
[
"help"
]))
{
...
...
@@ -45,8 +41,6 @@ if ($dry_run) {
echo
"DRY RUN MODE IS ON
\n
"
;
}
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
...
...
@@ -528,5 +522,3 @@ echo "\n" . gettext('Press <ENTER> to continue.');
fgets
(
$fp
);
fclose
(
$fp
);
?>
src/etc/rc.initial.setports
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -29,22 +27,17 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"config.console.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
require_once
(
"ipsec.inc"
);
require_once
(
"vpn.inc"
);
require_once
(
"captiveportal.inc"
);
require_once
(
"rrd.inc"
);
set_networking_interfaces_ports
();
reload_interfaces_sync
();
/* reload graphing functions */
enable_rrd_graphing
();
?>
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"config.console.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
require_once
(
"ipsec.inc"
);
require_once
(
"vpn.inc"
);
require_once
(
"captiveportal.inc"
);
require_once
(
"rrd.inc"
);
set_networking_interfaces_ports
();
reload_interfaces_sync
();
enable_rrd_graphing
();
src/etc/rc.interfaces_wan_configure
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.kill_states
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2013 Renato Botelho (garga@pfsense.org)
part of pfSense (https://www.pfsense.org)
Copyright (C) 2013 Renato Botelho <garga@pfsense.org>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
...
...
src/etc/rc.linkup
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense
Copyright (C) 2003-2005 Scott Ullrich <sullrich@gmail.com>.
All rights reserved.
...
...
@@ -83,7 +81,6 @@ function handle_argument_group($iface, $argument2) {
}
}
global
$g
;
if
(
!
file_exists
(
"/var/run/booting"
))
{
if
(
isset
(
$_GET
))
{
if
(
!
empty
(
$_GET
[
'interface'
]))
...
...
@@ -92,22 +89,21 @@ if (!file_exists("/var/run/booting")) {
if
(
$argc
<
3
)
{
log_error
(
"HOTPLUG event: The number of required parameters not passed!"
);
exit
;
}
$action
=
$argv
[
1
];
switch
(
$action
)
{
case
"start"
:
case
"stop"
:
break
;
default
:
log_error
(
"HOTPLUG event: The action parameter passed is wrong(
$action
) only start/stop/up/down are allowed!"
);
exit
;
/* NOTREACHED */
break
;
}
$interface
=
convert_real_interface_to_friendly_interface_name
(
$argv
[
2
]);
if
(
!
empty
(
$interface
))
{
handle_argument_group
(
$interface
,
$action
);
}
}
$action
=
$argv
[
1
];
switch
(
$action
)
{
case
"start"
:
case
"stop"
:
break
;
default
:
log_error
(
"HOTPLUG event: The action parameter passed is wrong(
$action
) only start/stop/up/down are allowed!"
);
exit
;
/* NOTREACHED */
break
;
}
$interface
=
convert_real_interface_to_friendly_interface_name
(
$argv
[
2
]);
if
(
!
empty
(
$interface
))
handle_argument_group
(
$interface
,
$action
);
}
}
?>
src/etc/rc.newipsecdns
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -57,4 +57,3 @@ if (isset($config['ipsec']['failoverforcereload']))
vpn_ipsec_force_reload
();
unlock
(
$ipseclck
);
?>
src/etc/rc.newroutedns
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -55,4 +55,3 @@ $routelck = lock('routedns', LOCK_EX);
system_staticroutes_configure
();
unlock
(
$routelck
);
?>
src/etc/rc.newwanip
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2006 Scott Ullrich
(sullrich@gmail.com)
Copyright (C) 2006 Scott Ullrich
<sullrich@gmail.com>
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -219,5 +219,3 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface
/* signal filter reload */
filter_configure
();
?>
src/etc/rc.newwanipv6
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
rc.newwanipv6
Copyright (C) 2006 Scott Ullrich (sullrich@gmail.com)
part of pfSense (https://www.pfsense.org)
Originally part of m0n0wall (http://m0n0.ch)
/*
Copyright (C) 2006 Scott Ullrich <sullrich@gmail.com>
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
...
...
@@ -173,5 +170,3 @@ enable_rrd_graphing();
services_igmpproxy_configure
();
restart_packages
();
?>
src/etc/rc.openvpn
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2007 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2009 Seth Mos <seth.mos@dds.nl>.
All rights reserved.
...
...
@@ -125,4 +124,3 @@ foreach ($arg_array as $arg_element) {
}
unlock
(
$openvpnlck
);
?>
src/etc/rc.php_test_run
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -36,5 +36,5 @@ if ($passed_tests) {
exit
(
0
);
}
// Tests failed.
echo
'FAILED'
;
exit
(
1
);
src/etc/rc.prunecaptiveportal
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.reload_all
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.reload_interfaces
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of pfSense (https://www.pfsense.org)
Copyright (C) 2004 Scott Ullrich
All rights reserved.
...
...
src/etc/rc.resolv_conf_generate
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2010 Ermal Luçi
All rights reserved.
...
...
@@ -31,5 +32,3 @@ require_once("config.inc");
require_once
(
"functions.inc"
);
system_resolvconf_generate
(
true
);
?>
src/etc/rc.restart_webgui
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
require_once
(
"config.inc"
);
...
...
src/etc/rc.restore_config_backup
View file @
a47ad5e7
#!/usr/local/bin/php
-q
#!/usr/local/bin/php
<?php
require_once
(
'config.inc'
);
cleanup_backupcache
();
...
...
@@ -122,5 +123,3 @@ while (true) {
}
fclose
(
$fp
);
die
;
?>
src/etc/rc.savevoucher
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
/*
Copyright (C) 2007 Marcel Wiget <mwiget@mac.com>.
All rights reserved.
...
...
@@ -28,13 +27,11 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
require_once
(
"captiveportal.inc"
);
require_once
(
"voucher.inc"
);
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"shaper.inc"
);
require_once
(
"captiveportal.inc"
);
require_once
(
"voucher.inc"
);
voucher_save_db_to_config
();
?>
voucher_save_db_to_config
();
src/etc/rc.sshd
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
src/etc/rc.start_packages
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
...
...
@@ -68,5 +68,3 @@ if ($shell) {
pclose
(
$shell
);
}
?>
src/etc/rc.stop_packages
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
require_once
(
"pkg-utils.inc"
);
stop_packages
();
?>
src/etc/rc.update_alias_url_data
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/* $Id$ */
/*
rc.update_alias_url-data.sh
part of pfSense (https://www.pfsense.org)
/*
Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
All rights reserved.
...
...
@@ -30,9 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
/* config.inc retrives the util.inc and globals.inc */
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
...
...
@@ -40,4 +34,3 @@ if (update_alias_url_data()) {
write_config
();
send_event
(
"filter reload"
);
}
?>
src/etc/rc.update_urltables
View file @
a47ad5e7
#!/usr/local/bin/php
-q
#!/usr/local/bin/php
<?php
require_once
(
"config.inc"
);
...
...
@@ -56,4 +56,3 @@ if (count($todo) > 0) {
if
(
$filter_reload
)
send_event
(
"filter reload"
);
}
?>
src/opnsense/service/configd_ctl.py
View file @
a47ad5e7
...
...
@@ -66,9 +66,3 @@ else:
print
(
data
[:
-
3
])
finally
:
sock
.
close
()
src/opnsense/service/execute_command.py
View file @
a47ad5e7
...
...
@@ -76,6 +76,3 @@ try:
print
(
'response:
%
s'
%
data
[:
-
3
]
)
finally
:
sock
.
close
()
src/sbin/gmirror_status_check.php
View file @
a47ad5e7
#!/usr/local/bin/php
-f
#!/usr/local/bin/php
<?php
/*
gmirror_status_check.php
Copyright (C) 2014 Jim Pingle
Redistribution and use in source and binary forms, with or without
...
...
@@ -26,12 +26,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/*
pfSense_BUILDER_BINARIES: /sbin/gmirror /sbin/geom /usr/bin/grep /usr/bin/egrep /usr/bin/cut /usr/bin/head
pfSense_BUILDER_BINARIES: /sbin/mount /usr/bin/awk /usr/bin/sed
pfSense_MODULE: gmirror
*/
require_once
(
"config.inc"
);
require_once
(
"notices.inc"
);
require_once
(
"globals.inc"
);
...
...
@@ -88,5 +82,3 @@ if (count($notices)) {
// Write out current status if changed
if
(
$mirror_status
!=
$previous_mirror_status
)
file_put_contents
(
$status_file
,
serialize
(
$mirror_status
));
?>
src/sbin/show_filter_reload_status.php
deleted
100755 → 0
View file @
cabdbf8c
#!/usr/local/bin/php -q
<?php
$last_text
=
""
;
while
(
!
stristr
(
$status
,
"Done"
))
{
$status
=
get_status
();
if
(
$status
<>
""
)
{
echo
$status
.
"
\n
"
;
}
sleep
(
1
);
}
function
get_status
()
{
global
$last_text
;
$status
=
file_get_contents
(
"/var/run/filter_reload_status"
);
$status
=
str_replace
(
"..."
,
""
,
$status
);
$status
.=
"..."
;
if
(
$status
<>
$last_text
)
{
$last_text
=
$status
;
return
$status
;
}
return
""
;
}
?>
src/www/diag_logs_vpn.php
View file @
a47ad5e7
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
...
...
src/www/status_queues.php
View file @
a47ad5e7
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2004, 2005 Scott Ullrich
...
...
@@ -34,7 +34,8 @@ header("Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1
header
(
"Cache-Control: post-check=0, pre-check=0"
,
FALSE
);
header
(
"Pragma: no-cache"
);
// HTTP/1.0
require
(
"guiconfig.inc"
);
require_once
(
"guiconfig.inc"
);
class
QueueStats
{
public
$queuename
;
public
$queuelength
;
...
...
@@ -306,4 +307,3 @@ function format_bits($bits) {
return
sprintf
(
"%d bps"
,
$bits
);
}
}
?>
src/www/uploadconfig.php
View file @
a47ad5e7
#!/usr/local/bin/php
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
...
...
@@ -27,8 +27,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require
(
"guiconfig.inc"
);
require_once
(
"guiconfig.inc"
);
header
(
"Content-Type: text/plain"
);
...
...
@@ -52,4 +51,3 @@ if ($_POST['config']) {
}
exit
(
0
);
?>
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