diff options
Diffstat (limited to 'init.d/netmount')
-rwxr-xr-x | init.d/netmount | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/init.d/netmount b/init.d/netmount index 7ead6d9e..e4885a7c 100755 --- a/init.d/netmount +++ b/init.d/netmount @@ -21,7 +21,7 @@ depend() { # Only have portmap as a dependency if there is a nfs mount in fstab that # is set to mount at boot local pmap="" - if need_portmap ; then + if need_portmap; then [ -x /etc/init.d/rpcbind ] \ && pmap="rpcbind" \ || pmap="portmap" @@ -37,7 +37,7 @@ start() { [ -x /etc/init.d/rpcbind ] && pmap="rpcbind" local x= fs= - for x in ${RC_NET_FS_LIST} ; do + for x in ${RC_NET_FS_LIST}; do case "${x}" in nfs|nfs4) # If the nfsmount script took care of the nfs filesystems, @@ -47,7 +47,7 @@ start() { # Only try to mount NFS filesystems if portmap was started. # This is to fix "hang" problems for new users who do not # add portmap to the default runlevel. - if need_portmap && ! service_started "${pmap}" ; then + if need_portmap && ! service_started "${pmap}"; then continue fi ;; @@ -63,28 +63,28 @@ start() { stop() { local x= fs= - for x in ${RC_NET_FS_LIST} ; do - fs="${fs}${fs:+,}${x}" - done ebegin "Unmounting network filesystems" - umount -at ${fs} - local retval=$? - eend ${retval} "Failed to simply unmount filesystems" + . "${RC_LIBDIR}/sh/rc-mount.sh" - if [ ${retval} -ne 0 ] ; then - . "${RC_LIBDIR}/sh/rc-mount.sh" - eindent - fs= - for x in ${RC_NET_FS_LIST} ; do - fs="${fs:+|}${x}" - done - do_unmount "umount" "" "" "^(${fs})$" - retval=$? - eoutdent + for x in ${RC_NET_FS_LIST} ; do + fs="${fs}${fs:+,}${x}" + done + if [ -n "${fs}" ]; then + umount -at ${fs} || eerror "Failed to simply unmount filesystems" fi - return ${retval} + eindent + fs= + for x in ${RC_NET_FS_LIST}; do + fs="${fs}${fs:+|}${x}" + done + [ -n "${fs}" ] && fs="^(${fs})$" + do_unmount "umount" ${fs:+--fstype-regex} ${fs} --netdev + retval=$? + + eoutdent + eend ${retval} "Failed to unmount network filesystems" } # vim: set ts=4 : |