rc.d/mountcritlocal: Clean up
authorAaron LI <aly@aaronly.me>
Fri, 14 Dec 2018 14:57:51 +0000 (22:57 +0800)
committerAaron LI <aly@aaronly.me>
Wed, 19 Dec 2018 13:31:22 +0000 (21:31 +0800)
Clean the code a bit and fix the style.

etc/rc.d/mountcritlocal

index 50b72fe..247e2ad 100644 (file)
@@ -2,7 +2,6 @@
 #
 # $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $
 # $FreeBSD: src/etc/rc.d/mountcritlocal,v 1.5 2003/06/01 01:43:37 gordon Exp $
-# $DragonFly: src/etc/rc.d/mountcritlocal,v 1.5 2005/11/19 21:47:32 swildner Exp $
 #
 
 # PROVIDE: mountcritlocal
@@ -20,30 +19,26 @@ mountcritlocal_start()
        # should be delayed until after network initialization.
        case ${extra_netfs_types} in
        [Nn][Oo])
-       ;;
-               *)
+               ;;
+       *)
                netfs_types="${netfs_types} ${extra_netfs_types}"
-                       ;;
-               esac
+               ;;
+       esac
 
-       # Mount everything except nfs filesystems.
-       mount_excludes='no'
+       # Mount everything except for network filesystems.
+       mount_excludes=""
        for i in ${netfs_types}; do
                fstype=${i%:*}
                mount_excludes="${mount_excludes}${fstype},"
        done
-       mount_excludes=${mount_excludes%,}
-       mount -a -t ${mount_excludes}
-       case $? in
-       0)
-               ;;
-       *)
+       debug "mount -a -t no${mount_excludes%,}"
+       mount -a -t no${mount_excludes%,}
+       err=$?
+       if [ ${err} -ne 0 ]; then
                echo 'Mounting /etc/fstab filesystems failed,' \
-                       ' startup aborted'
-               exit 1
-               ;;
-               esac
-
+                    'startup aborted'
+               exit ${err}
+       fi
 }
 
 load_rc_config $name