diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2023-02-18 07:51:52 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2023-02-18 07:51:52 +0000 |
| commit | 38af277c3ca0216f17177af563519fa9dd55d78c (patch) | |
| tree | b28153ef676fe860b3d0ded5c797aedcaf098ff6 /etc | |
| parent | 85c1ca98f837c652b0219e509c3e9030ed8ff0f3 (diff) | |
Handle missing auth file.
Skip empty lines.
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/rc.d/iscsid_volumes | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/etc/rc.d/iscsid_volumes b/etc/rc.d/iscsid_volumes index a593a90714e..57efed4f0c3 100755 --- a/etc/rc.d/iscsid_volumes +++ b/etc/rc.d/iscsid_volumes @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: iscsid_volumes,v 1.2 2023/02/06 11:53:03 martin Exp $ +# $NetBSD: iscsid_volumes,v 1.3 2023/02/18 07:51:52 mlelstv Exp $ # # PROVIDE: iscsid_volumes @@ -20,7 +20,7 @@ iscsid_volumes_start() while read host target digest auth user alias; do case $host in - \#*) ;; + \#*|"") ;; *) topts='' case $digest in @@ -33,13 +33,15 @@ iscsid_volumes_start() pass="-" mpass="-" - while read entry dummy; do - case $entry in - \#*) ;; - "$user":*) pass=${entry#*:} ;; - "$target":*) mpass=${entry#*:} ;; - esac - done < /etc/iscsi/auths + if [ -f /etc/iscsi/auths ]; then + while read entry dummy; do + case $entry in + \#*|"") ;; + "$user":*) pass=${entry#*:} ;; + "$target":*) mpass=${entry#*:} ;; + esac + done < /etc/iscsi/auths + fi case $host in *:*) @@ -82,7 +84,7 @@ iscsid_volumes_stop() while read host target digest auth user alias; do case $host in - \#*) ;; + \#*|"") ;; *) echo "Remove target ${alias:-$target}" |
