help!! can someone please explain me this script

Discussion in 'Open Source' started by iinfi, Jun 21, 2009.

Thread Status:
Not open for further replies.
  1. iinfi

    iinfi mekalodu

    Joined:
    Oct 22, 2004
    Messages:
    1,534
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Navi Mumbai
    i m no good in scripting.
    the source is here
    http://www.idevelopment.info/data/U...html#Configure iSCSI Initiator and New Volume

    and the code is here
    Code:
    /etc/udev/scripts/iscsidev.sh
    
    #!/bin/sh
    
    # FILE: /etc/udev/scripts/iscsidev.sh
    
    BUS=${1}
    HOST=${BUS%%:*}
    
    [ -e /sys/class/iscsi_host ] || exit 1
    
    file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
    
    target_name=$(cat ${file})
    
    # This is not an open-scsi drive
    if [ -z "${target_name}" ]; then
       exit 1
    fi
    
    echo "${target_name##*.}"
    
    for the time being i need ur help in understanding this.
    spoon feeding apart .. plz direct me to a place where i can understand scripting. i know there are scores on the net. any good tutorial which you folks may v used.

    thanks
     
  2. ManishSinha

    ManishSinha Addicted to FOSS

    Joined:
    Jan 5, 2008
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Manipal
  3. OP
    OP
    iinfi

    iinfi mekalodu

    Joined:
    Oct 22, 2004
    Messages:
    1,534
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Navi Mumbai
    thank you ....
     
Thread Status:
Not open for further replies.

Share This Page