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 check to remove the temporarily (...



details:   https://anonhg.NetBSD.org/src/rev/24e3e26aa806
branches:  trunk
changeset: 326083:24e3e26aa806
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jan 17 19:06:57 2014 +0000

description:
Add a check to remove the temporarily (eroneously) created /@RUNDIR@
(PR bin/48529)

diffstat:

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

diffs (42 lines):

diff -r b9a58fb26d86 -r 24e3e26aa806 usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Fri Jan 17 18:36:25 2014 +0000
+++ b/usr.sbin/postinstall/postinstall  Fri Jan 17 19:06:57 2014 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.161 2013/12/17 12:51:26 njoly Exp $
+# $NetBSD: postinstall,v 1.162 2014/01/17 19:06:57 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -796,6 +796,30 @@
 }
 
 #
+#      dhcpcdrundir
+#
+additem dhcpcdrundir "accientaly created /@RUNDIR@ does not exist"
+do_dhcpcdrundir()
+{
+       [ -n "$1" ] || err 3 "USAGE: do_dhcpcdrundir fix|check"
+       op="$1"
+       failed=0
+
+       if [ -d /@RUNDIR@ ]; then
+               if [ "${op}" = "check" ]; then
+                       msg "Remove eroneously created /@RUNDIR@"
+                       failed=1
+               elif ! eval "rm -r /@RUNDIR@"; then
+                       msg "Failed to remove /@RUNDIR@"
+                       failed=1
+               else
+                       msg "Removed eroneously created /@RUNDIR@"
+               fi
+       fi
+       return ${failed}
+}
+
+#
 #      envsys
 #
 additem envsys "envsys configuration is up to date"



Home | Main Index | Thread Index | Old Index