/etc/init.d/scst: Relax parsing of /etc/scst.conf. Accept sequences of blanks and tabs instead of only spaces when looking for device handler and target driver names.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-06-11 10:26:25 +00:00
parent 4ce84f3edb
commit aa199d8ef6

View File

@@ -81,8 +81,9 @@ parse_scst_conf() {
if [ ! -e $SCST_CFG ]; then
return 1
fi
local blanks="[ ]\{1,\}"
SCST_MODULES="scst `
sed -n -e 's/^HANDLER \(.*\) {$/\1/p' -e 's/^\[HANDLER \(.*\)\]$/\1/p' \
sed -n -e 's/^HANDLER'"$blanks"'\(.*\)'"$blanks"'{$/\1/p' -e 's/^\[HANDLER'"$blanks"'\(.*\)\]$/\1/p' \
$SCST_CFG \
| while read h; do
case "$h" in
@@ -98,7 +99,7 @@ parse_scst_conf() {
*) echo "$h";;
esac
done | sort -u;
sed -n 's/^TARGET_DRIVER \(.*\) {$/\1/p' $SCST_CFG | while read d; do
sed -n 's/^TARGET_DRIVER'"$blanks"'\(.*\)'"$blanks"'{$/\1/p' $SCST_CFG | while read d; do
case "$d" in
iscsi) echo iscsi_scst;;
qla2x00t) echo qla2x00tgt;;