summaryrefslogtreecommitdiffstats
path: root/etc/rc.banner
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-06-13 16:20:07 -0400
committerjim-p <jimp@pfsense.org>2012-06-13 16:20:07 -0400
commit29e566a1a40706fa8318ddd6a2f249b75dd32169 (patch)
treec22bf4a79021dfa8c56ed21cd46aaf9ee44fdc22 /etc/rc.banner
parentbd0c22951d3bba51582fd5e768f484bd462eaf34 (diff)
downloadpfsense-29e566a1a40706fa8318ddd6a2f249b75dd32169.zip
pfsense-29e566a1a40706fa8318ddd6a2f249b75dd32169.tar.gz
Rework the banner display a bit to preserve space (could still use some shortening, but better than it was)
Diffstat (limited to 'etc/rc.banner')
-rwxr-xr-xetc/rc.banner55
1 files changed, 45 insertions, 10 deletions
diff --git a/etc/rc.banner b/etc/rc.banner
index 8694011..901286f 100755
--- a/etc/rc.banner
+++ b/etc/rc.banner
@@ -55,18 +55,38 @@
/* look for 'special cases' */
switch($ifconf['ipaddr']) {
case "dhcp":
- $class = "(DHCP)";
+ $class = "/DHCP4";
break;
case "pppoe":
- $class = "(PPPoE)";
+ $class = "/PPPoE";
break;
case "pptp":
- $class = "(PPTP)";
+ $class = "/PPTP";
+ break;
+ case "l2tp":
+ $class = "/L2TP";
break;
default:
$class = "";
break;
}
+ switch($ifconf['ipaddrv6']) {
+ case "dhcp6":
+ $class6 = "/DHCP6";
+ break;
+ case "slaac":
+ $class6 = "/SLAAC";
+ break;
+ case "6rd":
+ $class6 = "/6RD";
+ break;
+ case "6to4":
+ $class6 = "/6to4";
+ break;
+ case "track6":
+ $class6 = "/t6";
+ break;
+ }
$ipaddr = get_interface_ip($ifname);
$subnet = get_interface_subnet($ifname);
$ipaddr6 = get_interface_ipv6($ifname);
@@ -74,15 +94,30 @@
$realif = get_real_interface($ifname);
$tobanner = "{$friendly} ({$ifname})";
- printf("\n %-15s -> %-10s -> %s/%s\t%s/%s %s",
+ printf("\n %-15s -> %-10s -> ",
$tobanner,
- $realif,
- $ipaddr ? $ipaddr : "NONE",
- $subnet ? $subnet : "NONE",
- $ipaddr6 ? $ipaddr6 : "NONE",
- $subnet6 ? $subnet6 : "NONE",
- $class
+ $realif
);
+ $v6first = false;
+ if (!empty($ipaddr) && !empty($subnet)) {
+ printf("v4%s: %s/%s",
+ $class,
+ $ipaddr,
+ $subnet
+ );
+ } else {
+ $v6first = true;
+ }
+ if (!empty($ipaddr6) && !empty($subnet6)) {
+ if (!$v6first) {
+ printf("\n%s", str_repeat(" ",34));
+ }
+ printf("v6%s: %s/%s",
+ $class6,
+ $ipaddr6,
+ $subnet6
+ );
+ }
}
?>
OpenPOWER on IntegriCloud