#!/bin/bash
#############################################################################
# #
# man2pdf #
# a simple bash script to convert a man page to pdf #
# #
# Copyright (C) 2003-2004 Trond Aasan #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# If you find this useful in any way, or if you find a bug, #
# feel free to e-mail me. #
# #
# Trond Aasan#
# http://www.aasan.org/ #
# #
#############################################################################
# $Id: man2pdf,v 1.6 2004/01/23 18:35:41 trondaas Exp $
MAN=$(which man)
if [ -z "$MAN" ]; then
echo "man executable not found in path" >&2
exit 1;
fi
GROFF=$(which groff)
if [ -z "$GROFF" ]; then
echo "groff executable not found in path" >&2
exit 1;
fi
GS=$(which gs)
if [ -z "$GS" ]; then
echo "gs executable not found in path" >&2
exit 1;
fi
USAGE="Usage: $0 [options][outfile]
Options:
-n SECTION man section
-h Print this help message
If no section is specified, use first hit.
If outfile is not specified, write output to. .pdf in
current directory.
"
unset MANSECT
while getopts 'n:h' opt; do
case $opt in
n )
export MANSECT="$OPTARG"
;;
h )
echo "$USAGE"
exit
;;
\? )
exit 1
;;
* )
echo "Error"
exit 1
;;
esac
done
shift $(($OPTIND - 1))
if [ -z "$1" ]; then
echo "$USAGE"
exit 1
fi
infile=$("$MAN" -w -- "$1") || exit $?
if [ -z "$MANSECT" ]; then
AWK=$(which awk)
if [ -z "$AWK" ]; then
echo "awk executable not found in path. Will not guess man"\
"section" >&2
else
BASENAME=$(which basename)
if [ -z "$BASENAME" ]; then
echo "basename executable not found in path. Will not guess man"\
"section" >&2
else
basename=$("$BASENAME" "$infile")
section=$(echo "$basename" | "$AWK" -F . \
"/$(echo "$1" | tr . '\.')\.([0-9a-zA-Z])(\.gz)?$/{print \$2}")
fi
fi
fi
case "$infile" in
*.gz | *.Z)
CAT=$(which zcat)
;;
*.bz)
CAT=$(which bzcat)
;;
*.bz2)
CAT=$(which bz2cat)
;;
*)
CAT=$(which cat)
;;
esac
if [ -z "$CAT" ]; then
exit 1
fi
if [ -n "$2" ]; then
outfile="$2"
else
if [ -n "$section" ]; then
outfile="$1.$section.pdf"
else
outfile="$1.pdf"
fi
fi
"$CAT" -- "$infile" | "$GROFF" -t -E -Tps -mandoc -ma4 \
| "$GS" -q -sDEVICE=pdfwrite -sOutputFile="$outfile" -dNOPAUSE -dBATCH -sPAPERSIZE='a4' -
[close]
Cisco Command "Auto secure" In today's article, I'm going to quickly inform you about the Privileged EXEC command named "auto secure". Network administrators (like you) use the "auto secure" command to secure the management and forwarding planes of a router. Another way of saying it is, CCNAs use this command to secure a router by disabling common IP services which can be exploited by attackers to initiate network attacks. When the command is typed on a router, it takes the user (ccna) through a command line-interface (CLI) semi-interactive session (which is also known as the AutoSecure dialogue). Below is the command's syntax: auto secure [management | forwarding] [no-interact | full] [ntp | login | ssh | firewall | tcp-intercept] As you can see, the command can use several "optional" keywords: management - This (optional) keyword is used to only secure the management plane of a router. forwarding - This (optional) keyword is used to...
Comments
Post a Comment