aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/preinit
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-02-01 00:32:46 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-02-01 00:32:46 +0000
commite367f5434ac49f709b9c6d9df6ecb1c5e0b79543 (patch)
treeec2f9b06f3f7c0cd6823ff488603a00c37c36ad0 /package/base-files/files/lib/preinit
parent34c0c72a6e045340d7ecd9c7b2673c299d7f2d9b (diff)
downloadupstream-e367f5434ac49f709b9c6d9df6ecb1c5e0b79543.tar.gz
upstream-e367f5434ac49f709b9c6d9df6ecb1c5e0b79543.tar.bz2
upstream-e367f5434ac49f709b9c6d9df6ecb1c5e0b79543.zip
base-files: preinit: get rid of /dev/null redirections and use grep -q where applicable
SVN-Revision: 19478
Diffstat (limited to 'package/base-files/files/lib/preinit')
-rw-r--r--package/base-files/files/lib/preinit/10_check_for_mtd2
-rw-r--r--package/base-files/files/lib/preinit/10_indicate_preinit6
-rw-r--r--package/base-files/files/lib/preinit/30_device_fs_daemons2
-rw-r--r--package/base-files/files/lib/preinit/50_choose_console2
4 files changed, 6 insertions, 6 deletions
diff --git a/package/base-files/files/lib/preinit/10_check_for_mtd b/package/base-files/files/lib/preinit/10_check_for_mtd
index e1f3c07a2a..66f185e1af 100644
--- a/package/base-files/files/lib/preinit/10_check_for_mtd
+++ b/package/base-files/files/lib/preinit/10_check_for_mtd
@@ -10,7 +10,7 @@ mount_no_mtd() {
check_for_mtd() {
check_skip || {
- grep rootfs_data /proc/mtd >/dev/null 2>/dev/null || {
+ grep -qs rootfs_data /proc/mtd || {
mount_no_mtd && pi_mount_skip_next=true
}
}
diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index cd3ca5571a..ab69305180 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -9,19 +9,19 @@ preinit_ip() {
pi_ifname=$ifname
fi
- [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && {
+ [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up
}
}
preinit_ip_deconfig() {
- [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && {
+ [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
ifconfig $pi_ifname 0.0.0.0 down
}
}
preinit_net_echo() {
- [ -n "$pi_ifname" ] && grep "$pi_ifname" /proc/net/dev >/dev/null && {
+ [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
{
[ "$pi_preinit_net_messages" = "y" ] || {
[ "$pi_failsafe_net_message" = "true" ] &&
diff --git a/package/base-files/files/lib/preinit/30_device_fs_daemons b/package/base-files/files/lib/preinit/30_device_fs_daemons
index 5a3aaf3d64..5b3e2ad000 100644
--- a/package/base-files/files/lib/preinit/30_device_fs_daemons
+++ b/package/base-files/files/lib/preinit/30_device_fs_daemons
@@ -23,7 +23,7 @@ init_udev() {
init_device_fs() {
HOTPLUG=
- if grep devfs /proc/filesystems > /dev/null; then
+ if grep -q devfs /proc/filesystems; then
init_devfs
elif [ -x /sbin/hotplug2 ]; then
init_hotplug2
diff --git a/package/base-files/files/lib/preinit/50_choose_console b/package/base-files/files/lib/preinit/50_choose_console
index 346479640e..ecbc2eaf42 100644
--- a/package/base-files/files/lib/preinit/50_choose_console
+++ b/package/base-files/files/lib/preinit/50_choose_console
@@ -7,7 +7,7 @@ choose_console() {
# that's why we use /dev/pty/m0 and m1 (or equivalent) as replacement
# for /dev/console if there's no serial console available
- if grep devfs /proc/filesystems > /dev/null; then
+ if grep -q devfs /proc/filesystems; then
M0=/dev/pty/m0
M1=/dev/pty/m1
M2=/dev/pty/m1