diff options
author | bapt <bapt@FreeBSD.org> | 2012-05-15 21:02:18 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2012-05-15 21:02:18 +0800 |
commit | 9625461adfd2f6c5ac788fb1951ff41049920a84 (patch) | |
tree | 84a2feaa81579777cde8b695a08a9c0f87934926 /net-mgmt/ssgless | |
parent | 1d65a0a9051bf7ee6f6a06b4887f6ef0af9b7c4e (diff) | |
download | freebsd-ports-gnome-9625461adfd2f6c5ac788fb1951ff41049920a84.tar.gz freebsd-ports-gnome-9625461adfd2f6c5ac788fb1951ff41049920a84.tar.zst freebsd-ports-gnome-9625461adfd2f6c5ac788fb1951ff41049920a84.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
Diffstat (limited to 'net-mgmt/ssgless')
-rw-r--r-- | net-mgmt/ssgless/Makefile | 40 | ||||
-rw-r--r-- | net-mgmt/ssgless/files/lesspipe-ssg.awk.in | 17 | ||||
-rw-r--r-- | net-mgmt/ssgless/files/ssgless.in | 3 | ||||
-rw-r--r-- | net-mgmt/ssgless/pkg-descr | 21 | ||||
-rw-r--r-- | net-mgmt/ssgless/pkg-message | 1 |
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 |