diff options
author | Bill Nottingham <notting@redhat.com> | 2003-01-07 04:58:31 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-01-07 04:58:31 +0000 |
commit | 3061c823c0566c5efeefae12d48d4bb95c2acc7a (patch) | |
tree | 28a7d440413737f252d2afd4052920af67f09741 /rc.d/init.d/rawdevices | |
parent | 52475e10f05f0f29437bce4ccf2d2d7560ead764 (diff) | |
download | initscripts-3061c823c0566c5efeefae12d48d4bb95c2acc7a.tar initscripts-3061c823c0566c5efeefae12d48d4bb95c2acc7a.tar.gz initscripts-3061c823c0566c5efeefae12d48d4bb95c2acc7a.tar.bz2 initscripts-3061c823c0566c5efeefae12d48d4bb95c2acc7a.tar.xz initscripts-3061c823c0566c5efeefae12d48d4bb95c2acc7a.zip |
speedups (<drepper@redhat.com>)
- use LC_ALL=C
- don't use both grep&awk on the same file, just use awk
Diffstat (limited to 'rc.d/init.d/rawdevices')
-rwxr-xr-x | rc.d/init.d/rawdevices | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rc.d/init.d/rawdevices b/rc.d/init.d/rawdevices index b55fa14f..e0639279 100755 --- a/rc.d/init.d/rawdevices +++ b/rc.d/init.d/rawdevices @@ -13,22 +13,24 @@ [ -f /usr/bin/raw ] || exit 0 [ -f /etc/sysconfig/rawdevices ] || exit 0 # Exit if the file just has the default comments. -/bin/grep -q -v "^#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0 +LC_ALL=C /bin/egrep -q -v "^ *#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0 . /etc/init.d/functions function assign_raw() { - cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do + LC_ALL=C egrep -v '^ *#' /etc/sysconfig/rawdevices | + while read RAW BLOCK; do if [ -n "$RAW" -a -n "$BLOCK" ]; then - if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then + rawdirname=${RAW%/*} + if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then echo $" Please correct your /etc/sysconfig/rawdevices:" echo $" rawdevices are now located in the directory /dev/raw/ " echo $" If the command 'raw' still refers to /dev/raw as a file." echo $" you'll have to upgrade your util-linux package" exit 0 fi - if [ "`dirname $RAW`" = "/dev/raw" -a -f /dev/raw ]; then + if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then echo $" Please correct your /etc/sysconfig/rawdevices:" echo $" rawdevices are now located in the directory /dev/raw/ " echo $" If the command 'raw' still refers to /dev/raw as a file." |