Add a check to remove the temporarily (eroneously) created /@RUNDIR@

(PR bin/48529)
This commit is contained in:
martin 2014-01-17 19:06:57 +00:00
parent 7a87327182
commit 319a65afc2

View File

@ -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.
@ -795,6 +795,30 @@ do_dhcpcd()
return ${failed}
}
#
# 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
#