#
# This implementation is incomplete: Discovery mode is not implemented and
# the argument handling doesn't follow currently agreed formats. This is mainly
-# because rfc4173 does not say anything about iscsi_initiator but open-iscsi's
+# because rfc4173 does not say anything about iscsi_initiator but open-iscsi's
# iscsistart needs this.
#
# Huh? Empty $2?
[ -z "$2" ] && exit 1
-# Huh? Empty $3? This isn't really necessary, since NEWROOT isn't
+# Huh? Empty $3? This isn't really necessary, since NEWROOT isn't
# used here. But let's be consistent
[ -z "$3" ] && exit 1
arg=$(getargs rd.iscsi.in.password iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
-handle_netroot()
+handle_netroot()
{
iroot=$1
# override conf/commandline options by dhcp root_path
IFS=@
set $iroot
if [ $# -gt 1 ]; then
- authinfo=$1; shift
+ authinfo=$1; shift
iroot=$*
# allow empty authinfo to allow having an @ in iscsi_target_name like this:
# netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
iscsi_in_password=$4
fi
fi
- fi
+ fi
IFS="$OLDIFS"
local v=${iroot}:
local i
- set --
+ set --
while [ -n "$v" ]; do
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
# handle IPv6 address
i="${i##\[}"
set -- "$@" "$i"
v=${v#\[$i\]:}
- else
+ else
set -- "$@" "${v%%:*}"
v=${v#*:}
fi
}
# loop over all netroot parameter
-if getarg netroot; then
- for nroot in $(getargs netroot); do
+if getarg netroot; then
+ for nroot in $(getargs netroot); do
[ "${netroot%%:*}" = "iscsi" ] || continue
handle_netroot ${nroot##iscsi:}
done