selecting the stanza fields

Hi Friends,

I have a stanza file as below :

CuDv:
name = "hdisk34"
status = 0
chgstatus = 3
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi0"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk10"
status = 1
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi0"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk11"
status = 0
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi1"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk12"
status = 1
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi1"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

I want the name and the parent fields only if the field "status=1"
i.e.,

hdisk10 fscsi0
hdisk12 fscsi1

( It should not show the disks hdisk34 and hdisk11 as their "status not equal to 1" ).

Urgent reply required..

Thanks in advance

#!/usr/bin/sh
while read line
do
  if echo $line | grep 'name = "' > /dev/null
  then
    disk=`echo $line | cut -d '"' -f 2`
  fi
  if echo $line | grep 'status = 1' > /dev/null
  then
    echo $disk
  fi
done

Usage: ./scriptname.sh < inputfile.txt