Search code examples
bashiscsi

bash script stops unexpectedly after second run from iscsiadm


iscsiadm stop / leave bash script, i dont know why ?

the "script"

#!/bin/bash
TMP=`/sbin/iscsiadm -m node -T ${iSCSI_DEVICE} -p ${IP}:3260 --login 2>/dev/null`
echo "Hallo Welt"

on first run it works great on second run ( iscsiadm run´s in an error ) i´ll never seen "Hallo Welt", i dont know why ?

have any one a solution for it ?


Solution

  • I have found it ..

    set -e

    wars the bad guy :-). After removing, the Scripts works fine