summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authormlelstv <mlelstv@NetBSD.org>2023-02-18 07:51:52 +0000
committermlelstv <mlelstv@NetBSD.org>2023-02-18 07:51:52 +0000
commit38af277c3ca0216f17177af563519fa9dd55d78c (patch)
treeb28153ef676fe860b3d0ded5c797aedcaf098ff6 /etc
parent85c1ca98f837c652b0219e509c3e9030ed8ff0f3 (diff)
Handle missing auth file.
Skip empty lines.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.d/iscsid_volumes22
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}"