diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-11-02 18:53:37 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-11-02 18:53:37 +0000 |
commit | 0afcc95525816bcd349a816951f38995efcbb50a (patch) | |
tree | 05bb41ed283ba0a5b95deae4d32179a527eec95b /etc/rc.banner | |
parent | 2c9b965a1941070d66ec2e34f6447b2d6bde0d9d (diff) | |
download | pfsense-0afcc95525816bcd349a816951f38995efcbb50a.zip pfsense-0afcc95525816bcd349a816951f38995efcbb50a.tar.gz |
* Carriage return before Welcome to pfsense
* Minor nitpick: Add 2 spaces before friendly name
Diffstat (limited to 'etc/rc.banner')
-rwxr-xr-x | etc/rc.banner | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/etc/rc.banner b/etc/rc.banner index 2c51973..2663f84 100755 --- a/etc/rc.banner +++ b/etc/rc.banner @@ -41,22 +41,51 @@ $buildtime = chop(file_get_contents("{$g['etc_path']}/version.buildtime")); $platform = chop(file_get_contents("{$g['etc_path']}/platform")); - $lanip = find_interface_ip($config['interfaces']['lan']['if']); - $wanip = find_interface_ip(get_real_wan_interface()); - - echo <<<EOD - -*** This is pfSense version {$version} - {$platform} *** - - LAN -> {$config['interfaces']['lan']['if']} -> {$lanip} - WAN -> {$config['interfaces']['wan']['if']} -> {$wanip} -EOD; - - for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { - $ipaddr = find_interface_ip($config['interfaces']['opt' . $i]['if']); - echo "\n OPT{$i} -> {$config['interfaces']['opt' . $i]['if']} -> "; - echo $ipaddr; - echo " ({$config['interfaces']['opt' . $i]['descr']})"; + $banner = "\n*** Welcome to pfSense version {$version} - {$platform} ***\n"; + + $iflist = get_interface_list("media"); + + foreach($iflist as $ifname => $ifinfo) { + $friendly = strtoupper($ifinfo['friendly']); + $ifconf =& $config['interfaces'][$ifinfo['friendly']]; + /* skip interfaces that don't have a friendly name */ + if($friendly != "") { + switch($ifconf['ipaddr']) { + case "dhcp": + $ifinfo['class'] = "DHCP"; + break; + case "pppoe": + $ifinfo['class'] = "PPPoE"; + $ifinfo['ipaddr'] = $iflist['ng0']['ipaddr']; + break; + case "pptp": + $ifinfo['class'] = "PPTP"; + $ifinfo['ipaddr'] = $iflist['ng0']['ipaddr']; + break; + } + /* print interface name */ + $tobanner = "\n {$friendly}"; + /* interface description */ + if($ifconf['descr']) { + $tobanner .= "({$ifconf['descr']})"; + } + /* is the interface up? */ + if($ifinfo['up']) { + $tobanner .= "*"; + } + /* pad banner to eliminate tab errors */ + $banner .= str_pad($tobanner, 25, " ", STR_PAD_RIGHT); + /* print physical if name */ + $banner .= "->\t{$ifname}\t->\t"; + /* do we have an IP? */ + $banner .= $ifinfo['ipaddr'] ? $ifinfo['ipaddr'] : "NONE"; + /* do we have an interface class? */ + if($ifinfo['class']) { + $banner .= "({$ifinfo['class']})"; + } + } } + print $banner; + ?>
\ No newline at end of file |