aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/ssgless
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-05-15 13:02:18 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-05-15 13:02:18 +0000
commitd13c52e63e82219f9c234ed416365180dc600382 (patch)
tree56feda3e55fceb01982780c6fa98e61cc54b591e /net-mgmt/ssgless
parentd0b29d1a9b596c922d55d3339161b6ba609d9a91 (diff)
downloadports-d13c52e63e82219f9c234ed416365180dc600382.tar.gz
ports-d13c52e63e82219f9c234ed416365180dc600382.zip
Viewer configuration files of devices with ScreenOS
(of Juniper Networks), considers the context of commands. For example to: set vrouter trust-vr sharable set vrouter "trust-vr" unset auto-route-export set protocol ospf set enable exit exit unset alg sip enable and after: set vrouter trust-vr sharable set vrouter "trust-vr" unset auto-route-export set protocol ospf set enable exit exit unset alg sip enable PR: ports/162676 Submitted by: Pavel I Volkov
Notes
Notes: svn path=/head/; revision=296669
Diffstat (limited to 'net-mgmt/ssgless')
-rw-r--r--net-mgmt/ssgless/Makefile40
-rw-r--r--net-mgmt/ssgless/files/lesspipe-ssg.awk.in17
-rw-r--r--net-mgmt/ssgless/files/ssgless.in3
-rw-r--r--net-mgmt/ssgless/pkg-descr21
-rw-r--r--net-mgmt/ssgless/pkg-message1
5 files changed, 82 insertions, 0 deletions
diff --git a/net-mgmt/ssgless/Makefile b/net-mgmt/ssgless/Makefile
new file mode 100644
index 000000000000..3a0fc3e7f1e5
--- /dev/null
+++ b/net-mgmt/ssgless/Makefile
@@ -0,0 +1,40 @@
+# New ports collection makefile for: ssgless
+# Date created: 8 Nov 2011
+# Whom: Pavel I Volkov
+#
+# $FreeBSD$
+#
+
+PORTNAME= ssgless
+PORTVERSION= 1.2
+CATEGORIES= net-mgmt
+DISTFILES=
+
+MAINTAINER= pavelivolkov@googlemail.com
+COMMENT= View ScreenOS configuration files
+
+LICENSE= BSD
+
+LESS= `whereis -bq less`
+
+NOFETCHFILES= yes
+NO_BUILD= yes
+NO_WRKSUBDIR= yes
+NO_MTREE= yes
+
+PLIST_FILES= bin/${PORTNAME} bin/lesspipe-ssg.awk
+
+SUB_FILES= ${PORTNAME} lesspipe-ssg.awk
+
+SUB_LIST= "AWK=${AWK}" "LESS=${LESS}"
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKDIR}/lesspipe-ssg.awk ${PREFIX}/bin
+
+post-install:
+ @${ECHO}
+ @${CAT} ${PKGMESSAGE}
+ @${ECHO}
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/ssgless/files/lesspipe-ssg.awk.in b/net-mgmt/ssgless/files/lesspipe-ssg.awk.in
new file mode 100644
index 000000000000..678331b6586b
--- /dev/null
+++ b/net-mgmt/ssgless/files/lesspipe-ssg.awk.in
@@ -0,0 +1,17 @@
+#!%%AWK%% -f
+BEGIN { count=1 }
+/^set anti-spam profile [^[:space:]]+\r?$/ ||
+/^set av profile [^[:space:]]+\r?$/ ||
+/^set vrouter [^[:space:]]+\r?$/ ||
+/^set protocol bgp/ ||
+/^set protocol ospf\r?$/ ||
+/^set protocol pim\r?$/ ||
+/^set protocol rip\r?$/ ||
+/^set crypto-policy\r?$/ ||
+/^set sctp configuration aaa\r?$/ ||
+/^set policy id [[:digit:]]+\r?$/ ||
+/^set url protocol [^[:space:]]+\r?$/ ||
+/^set route-map name / { out($0,count); count++; next }
+/^exit\r?$/ { count-- }
+{ out($0,count) }
+function out(s,c) { for(i=1; i<c; i++) printf("%s","\t"); print s }
diff --git a/net-mgmt/ssgless/files/ssgless.in b/net-mgmt/ssgless/files/ssgless.in
new file mode 100644
index 000000000000..a8f8fa44391f
--- /dev/null
+++ b/net-mgmt/ssgless/files/ssgless.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+export LESSOPEN="|%%PREFIX%%/bin/lesspipe-ssg.awk %s"
+exec %%LESS%% "$@"
diff --git a/net-mgmt/ssgless/pkg-descr b/net-mgmt/ssgless/pkg-descr
new file mode 100644
index 000000000000..aed18a1aa97a
--- /dev/null
+++ b/net-mgmt/ssgless/pkg-descr
@@ -0,0 +1,21 @@
+Viewer configuration files of devices with ScreenOS
+(of Juniper Networks), considers the context of commands.
+
+ For example to:
+set vrouter trust-vr sharable
+set vrouter "trust-vr"
+unset auto-route-export
+set protocol ospf
+set enable
+exit
+exit
+unset alg sip enable
+ and after:
+set vrouter trust-vr sharable
+set vrouter "trust-vr"
+ unset auto-route-export
+ set protocol ospf
+ set enable
+ exit
+exit
+unset alg sip enable
diff --git a/net-mgmt/ssgless/pkg-message b/net-mgmt/ssgless/pkg-message
new file mode 100644
index 000000000000..7b6835962b17
--- /dev/null
+++ b/net-mgmt/ssgless/pkg-message
@@ -0,0 +1 @@
+usage: ssgless -x3 ssg-device_cfg.txt