From 9300fa240d40b563034752f34860e418f044e738 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 31 Jan 2008 09:48:58 +0000 Subject: Tidy up some code and remove the redundant single_user function as we now use exit codes. --- sh.BSD/init.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sh.BSD') diff --git a/sh.BSD/init.sh b/sh.BSD/init.sh index 71902c51..a9797c95 100755 --- a/sh.BSD/init.sh +++ b/sh.BSD/init.sh @@ -2,13 +2,6 @@ # Copyright 2007-2008 Roy Marples # All rights reserved. Released under the 2-clause BSD license. -# void single_user() -# Drop to a shell, remount / ro, and then reboot -single_user() -{ - exit 1 -} - # This basically mounts $svcdir as a ramdisk, but preserving its content # which allows us to run depscan.sh # FreeBSD has a nice ramdisk - we don't set a size as we should always @@ -17,7 +10,7 @@ single_user() # FreeBSD-7 supports tmpfs now :) mount_svcdir() { - local dotmp=false release=false + local dotmp=false release=false retval=0 if [ -e "${RC_SVCDIR}"/deptree ]; then dotmp=true if ! mount -t tmpfs none "${RC_LIBDIR}"/tmp 2>/dev/null; then @@ -34,12 +27,15 @@ mount_svcdir() newfs -b 4096 -i 1024 -n /dev/md0 mount -o rw,noexec,nosuid /dev/md0 "${RC_SVCDIR}" fi + retval=$? if ${dotmp}; then cp -p "${RC_LIBDIR}"/tmp/deptree "${RC_LIBDIR}"/tmp/depconfig \ "${RC_LIBDIR}"/tmp/nettree "${RC_SVCDIR}" 2>/dev/null umount "${RC_LIBDIR}"/tmp ${release} && mdconfig -d -u 1 fi + + return ${retval} } . "${RC_LIBDIR}"/sh/functions.sh -- cgit v1.2.3