Project

General

Profile

Download (2.57 KB) Statistics
| Branch: | Tag: | Revision:
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 e7693c09 Ermal Lu?i
	Copyright (C) 2009 Ermal Lu?i
10 9e6d1022 Scott Ullrich
	All rights reserved
11 7b9ae57a Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 7b9ae57a Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 7b9ae57a Scott Ullrich
18 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21 7b9ae57a Scott Ullrich
22 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
	/* parse the configuration and include all functions used below */
35 8dcc8bbc Scott Ullrich
	require_once("config.inc");
36
	require_once("interfaces.inc");
37 5b237745 Scott Ullrich
38 cd718d54 Scott Ullrich
	$version  = trim(file_get_contents("{$g['etc_path']}/version"));
39 c6ee5ce4 Scott Ullrich
	$platform = trim(file_get_contents("{$g['etc_path']}/platform"));
40 a2cb1b3f Scott Ullrich
	$hostname = $config['system']['hostname'];
41 3d7639eb Scott Ullrich
	$product = $g['product_name'];
42
	$hideplatform = $g['hideplatform'];
43 cd718d54 Scott Ullrich
	
44 3d7639eb Scott Ullrich
	if(!$hideplatform) 
45
		$platformbanner = "-{$platform}";
46
	
47
	print "\n*** Welcome to {$product} {$version}{$platformbanner} on {$hostname} ***\n";
48 0afcc955 Scott Ullrich
49 e7693c09 Ermal Lu?i
	$iflist = get_configured_interface_with_descr(false, true);
50
	foreach($iflist as $ifname => $friendly) {
51
		/* point to this interface's config */
52
		$ifconf =& $config['interfaces'][$ifname];
53
		/* look for 'special cases' */
54
		switch($ifconf['ipaddr']) {
55
		case "carpdev-dhcp":
56
			$class = "(CarpDEV)";
57
			break;
58
		case "dhcp":
59
			$class = "(DHCP)";
60
			break;
61
		case "pppoe":
62
			$class = "(PPPoE)";
63
			break;
64
		case "pptp":
65
			$class = "(PPTP)";
66
			break;
67
		default:
68
			$class = "";
69
			break;
70 0afcc955 Scott Ullrich
		}
71 e7693c09 Ermal Lu?i
		$ipaddr = get_interface_ip($ifname);
72
		$realif = get_real_interface($ifname);
73
		$tobanner = "{$friendly}({$ifname})";
74
75
		printf("\n  %-25s -> %-10s -> %s%s",
76
			$tobanner,
77
			$realif,
78
			$ipaddr ? $ipaddr : "NONE",
79
			$class
80
		);
81 a438eb98 Scott Ullrich
	}
82 a2cb1b3f Scott Ullrich
?>