diff options
author | Bill Nottingham <notting@redhat.com> | 2007-08-29 18:46:34 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2007-08-29 18:46:34 +0000 |
commit | bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f (patch) | |
tree | ea6f8dcf0e89cffdc0b3005fee33e3f7e90f3101 /rc.d/init.d/functions | |
parent | 65c11539f1724621a6cadcf96fb11894cce9f241 (diff) | |
download | initscripts-bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f.tar initscripts-bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f.tar.gz initscripts-bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f.tar.bz2 initscripts-bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f.tar.xz initscripts-bfcdfb7fb5372264b7b78ddbfafdc9a3c2444e5f.zip |
optimize out some excess greps (<harald@redhat.com>)
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-x | rc.d/init.d/functions | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 528c050f..e85cff20 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -75,6 +75,18 @@ __readlink() { ls -bl "$@" 2>/dev/null| awk '{ print $NF }' } +__fgrep() { + s=$1 + f=$2 + while read line; do + if strstr "$line" "$s"; then + echo $line + return 0 + fi + done < $f + return 1 +} + # __umount_loop awk_program fstab_file first_msg retry_msg umount_args # awk_program should process fstab_file and return a list of fstab-encoded # paths; it doesn't have to handle comments in fstab_file. |