base-files: localize variable in do_move_devtmpfs(), remove extra temporary variable...
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 24 Jul 2010 19:33:11 +0000 (19:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 24 Jul 2010 19:33:11 +0000 (19:33 +0000)
SVN-Revision: 22380

package/base-files/files/lib/preinit/20_device_fs_mount

index 6ba7ccc6f18337ffaf58c1d992df54ebc49294db..283aa0a9d18b5fb74ca90b57b8e4ea0730ccfe85 100644 (file)
@@ -3,13 +3,10 @@
 # Copyright (C) 2010 Vertical Communications
 
 do_move_devtmpfs() {
-    foo="`grep devtmpfs /proc/mounts`"
-    x=${foo#* }
-    x=${x%% *}
+    local mnt="$(grep devtmpfs /proc/mounts)"
+          mnt="${mnt#* }"; mnt="${mnt%% *}"
 
-    if [ "$x" != "/dev" ] ; then
-       mount -o move "$x" /dev
-    fi
+    [ "$mnt" = "/dev" ] || mount -o move "$mnt" /dev
 }
 
 do_mount_devfs() {