aboutsummaryrefslogtreecommitdiff
path: root/security/portaudit/files/portaudit-cmd.sh
diff options
context:
space:
mode:
authorOliver Eikemeier <eik@FreeBSD.org>2004-02-21 21:19:41 +0000
committerOliver Eikemeier <eik@FreeBSD.org>2004-02-21 21:19:41 +0000
commitdd190f52fe548fc53c347207f55deacb01c69830 (patch)
tree2a078cd42e9e3643ed6e1d88c51f33ed5db9c860 /security/portaudit/files/portaudit-cmd.sh
parentb31b5c61b0c85c8cef3184fb8d940388a571be32 (diff)
Notes
Diffstat (limited to 'security/portaudit/files/portaudit-cmd.sh')
-rw-r--r--security/portaudit/files/portaudit-cmd.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/security/portaudit/files/portaudit-cmd.sh b/security/portaudit/files/portaudit-cmd.sh
new file mode 100644
index 000000000000..76b43ec458ae
--- /dev/null
+++ b/security/portaudit/files/portaudit-cmd.sh
@@ -0,0 +1,67 @@
+#!/bin/sh -ef
+#
+# Copyright (c) 2004 Oliver Eikemeier. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the author nor the names of its contributors may be
+# used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+. %%DATADIR%%/portaudit.functions
+portaudit_confs
+
+if [ $# -eq 0 ] ; then
+ portaudit_prerequisites
+ audit_installed || true
+fi
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -a)
+ portaudit_prerequisites
+ audit_installed || true
+ ;;
+ -V)
+ echo "portaudit version %%PORTVERSION%%"
+ ;;
+ -d)
+ if [ ! -f "${portaudit_dir}/${portaudit_filename}" ]; then
+ echo "portaudit: database missing. run \`portaudit -F' to update."
+ exit 2
+ fi
+ if ! checksum_auditfile; then
+ echo "portaudit: database corrupt."
+ exit 2
+ fi
+ echo "database created: `getcreated_auditfile`"
+ ;;
+ -F)
+ fetch_auditfile || echo "failed."
+ ;;
+ esac
+ shift
+done