Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/postinstall Add a new check to populate /var/chroot...



details:   https://anonhg.NetBSD.org/src/rev/ab4e3d8275ea
branches:  trunk
changeset: 764116:ab4e3d8275ea
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Apr 11 20:29:50 2011 +0000

description:
Add a new check to populate /var/chroot/tcpdump/etc

diffstat:

 usr.sbin/postinstall/postinstall |  25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 5230c7baaf69 -r ab4e3d8275ea usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Mon Apr 11 20:08:10 2011 +0000
+++ b/usr.sbin/postinstall/postinstall  Mon Apr 11 20:29:50 2011 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.115 2011/03/12 23:04:16 erh Exp $
+# $NetBSD: postinstall,v 1.116 2011/04/11 20:29:50 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1465,6 +1465,29 @@
 
 
 #
+#      tcpdumpchroot
+#
+additem tcpdumpchroot "make sure /var/chroot/tcpdump/etc is populated"
+do_tcpdumpchroot()
+{
+       [ -n "$1" ] || err 3 "USAGE: do_tcpdumpchroot  fix|check"
+
+       failed=0;
+       if [ ! -r ${DEST_DIR}/var/chroot/tcpdump/etc/protocols ]; then
+               if [ "$1" = "fix" ]; then
+                       mkdir -p ${DEST_DIR}/var/chroot/tcpdump/etc
+                       cp ${SRC_DIR}/etc/protocols \
+                               ${DEST_DIR}/var/chroot/tcpdump/etc
+                       failed=$(( ${failed} + $? ))
+               else
+                       failed=1
+               fi
+       fi
+       return ${failed}
+}
+
+
+#
 #      obsolete
 #      (this item is last to allow other items to move obsolete files)
 #



Home | Main Index | Thread Index | Old Index