summaryrefslogtreecommitdiff
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-07-24 19:33:11 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-07-24 19:33:11 +0000
commit9bf9ea98021946eea67331745472546be8d600fb (patch)
tree24c4141221851fe8450a56883aa70137e712dc66 /package/base-files/files/lib
parent6a85a3b53b41fe8e565ba353bb3b1c76701c8e05 (diff)
downloadmtk-20170518-9bf9ea98021946eea67331745472546be8d600fb.zip
mtk-20170518-9bf9ea98021946eea67331745472546be8d600fb.tar.gz
mtk-20170518-9bf9ea98021946eea67331745472546be8d600fb.tar.bz2
base-files: localize variable in do_move_devtmpfs(), remove extra temporary variable and shorten conditional
SVN-Revision: 22380
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r--package/base-files/files/lib/preinit/20_device_fs_mount9
1 files changed, 3 insertions, 6 deletions
diff --git a/package/base-files/files/lib/preinit/20_device_fs_mount b/package/base-files/files/lib/preinit/20_device_fs_mount
index 6ba7ccc..283aa0a 100644
--- a/package/base-files/files/lib/preinit/20_device_fs_mount
+++ b/package/base-files/files/lib/preinit/20_device_fs_mount
@@ -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() {