1 |
5b237745
|
Scott Ullrich
|
#!/usr/local/bin/php -f
|
2 |
|
|
<?php
|
3 |
|
|
/*
|
4 |
c6ee5ce4
|
Scott Ullrich
|
$Id$
|
5 |
|
|
|
6 |
5b237745
|
Scott Ullrich
|
rc.banner
|
7 |
9e6d1022
|
Scott Ullrich
|
part of pfSense
|
8 |
c6ee5ce4
|
Scott Ullrich
|
Copyright (C) 2005 Scott Ullrich and Colin Smith
|
9 |
9e6d1022
|
Scott Ullrich
|
All rights reserved
|
10 |
7b9ae57a
|
Scott Ullrich
|
|
11 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
12 |
|
|
modification, are permitted provided that the following conditions are met:
|
13 |
7b9ae57a
|
Scott Ullrich
|
|
14 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
15 |
|
|
this list of conditions and the following disclaimer.
|
16 |
7b9ae57a
|
Scott Ullrich
|
|
17 |
5b237745
|
Scott Ullrich
|
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 |
7b9ae57a
|
Scott Ullrich
|
|
21 |
5b237745
|
Scott Ullrich
|
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 |
|
|
/* parse the configuration and include all functions used below */
|
34 |
|
|
require_once("config.inc");
|
35 |
35b0fa76
|
Scott Ullrich
|
require_once("functions.inc");
|
36 |
5b237745
|
Scott Ullrich
|
|
37 |
c6ee5ce4
|
Scott Ullrich
|
$version = trim(file_get_contents("{$g['etc_path']}/version"));
|
38 |
|
|
$platform = trim(file_get_contents("{$g['etc_path']}/platform"));
|
39 |
a2cb1b3f
|
Scott Ullrich
|
$hostname = $config['system']['hostname'];
|
40 |
7b9ae57a
|
Scott Ullrich
|
|
41 |
a2cb1b3f
|
Scott Ullrich
|
print "\n*** Welcome to pfSense {$version}-{$platform} on {$hostname} ***\n";
|
42 |
0afcc955
|
Scott Ullrich
|
|
43 |
c6ee5ce4
|
Scott Ullrich
|
/* get our initial interface list */
|
44 |
a2cb1b3f
|
Scott Ullrich
|
$vfaces = array(
|
45 |
|
|
'ppp',
|
46 |
|
|
'sl',
|
47 |
|
|
'gif',
|
48 |
|
|
'faith',
|
49 |
|
|
'lo',
|
50 |
|
|
'tun',
|
51 |
|
|
'pflog',
|
52 |
|
|
'pfsync',
|
53 |
|
|
'carp'
|
54 |
|
|
);
|
55 |
|
|
$iflist = get_interface_list("media", "physical", $vfaces);
|
56 |
0afcc955
|
Scott Ullrich
|
|
57 |
|
|
foreach($iflist as $ifname => $ifinfo) {
|
58 |
|
|
/* skip interfaces that don't have a friendly name */
|
59 |
c6ee5ce4
|
Scott Ullrich
|
if($ifinfo['friendly'] != "") {
|
60 |
|
|
$friendly = strtoupper($ifinfo['friendly']);
|
61 |
|
|
/* point to this interface's config */
|
62 |
|
|
$ifconf =& $config['interfaces'][$ifinfo['friendly']];
|
63 |
|
|
/* look for 'special cases' */
|
64 |
0afcc955
|
Scott Ullrich
|
switch($ifconf['ipaddr']) {
|
65 |
|
|
case "dhcp":
|
66 |
c6ee5ce4
|
Scott Ullrich
|
$ifinfo['class'] = "(DHCP)";
|
67 |
0afcc955
|
Scott Ullrich
|
break;
|
68 |
|
|
case "pppoe":
|
69 |
c6ee5ce4
|
Scott Ullrich
|
$ifinfo['class'] = "(PPPoE)";
|
70 |
a2cb1b3f
|
Scott Ullrich
|
$ifinfo['ipaddr'] = $iflist[$g['pppoe_interface']]['ipaddr'];
|
71 |
0afcc955
|
Scott Ullrich
|
break;
|
72 |
|
|
case "pptp":
|
73 |
c6ee5ce4
|
Scott Ullrich
|
$ifinfo['class'] = "(PPTP)";
|
74 |
a2cb1b3f
|
Scott Ullrich
|
$ifinfo['ipaddr'] = $iflist[$g['pppoe_interface']]['ipaddr'];
|
75 |
0afcc955
|
Scott Ullrich
|
break;
|
76 |
|
|
}
|
77 |
c6ee5ce4
|
Scott Ullrich
|
$tobanner = $friendly;
|
78 |
|
|
/* does this interface have an extra description? */
|
79 |
0afcc955
|
Scott Ullrich
|
if($ifconf['descr']) {
|
80 |
|
|
$tobanner .= "({$ifconf['descr']})";
|
81 |
|
|
}
|
82 |
|
|
/* is the interface up? */
|
83 |
|
|
if($ifinfo['up']) {
|
84 |
|
|
$tobanner .= "*";
|
85 |
|
|
}
|
86 |
c6ee5ce4
|
Scott Ullrich
|
printf("\n %-25s->\t%s\t->\t%s%s",
|
87 |
|
|
$tobanner,
|
88 |
|
|
$ifname,
|
89 |
|
|
$ifinfo['ipaddr'] ? $ifinfo['ipaddr'] : "NONE",
|
90 |
|
|
$ifinfo['class']
|
91 |
|
|
);
|
92 |
0afcc955
|
Scott Ullrich
|
}
|
93 |
a438eb98
|
Scott Ullrich
|
}
|
94 |
a2cb1b3f
|
Scott Ullrich
|
?>
|