promiseutil(8) fails to run when it has no valid terminal, for example
when using ssh. So we run it inside a screen(1) session now ...
if [ `uname` = "Darwin" ]; then
tmp=`mktemp "/tmp/$$.XXXX"`
if [ `uname` = "Darwin" ]; then
tmp=`mktemp "/tmp/$$.XXXX"`
+ tmp2=`mktemp "/tmp/$$-2.XXXX"`
LC_ALL=C diskutil checkRAID >"$tmp" 2>/dev/null
if [ $? -eq 0 ]; then
# Apple Software-RAID detected
LC_ALL=C diskutil checkRAID >"$tmp" 2>/dev/null
if [ $? -eq 0 ]; then
# Apple Software-RAID detected
TEXT="$TEXT Apple HW-RAID status is unknown ($status)!?"
fi
fi
TEXT="$TEXT Apple HW-RAID status is unknown ($status)!?"
fi
fi
- LC_ALL=C promiseutil -C array -a list -v 2>/dev/null </dev/tty \
- | grep -A8 '^LdId' | grep '^[0-9]' >"$tmp"
+ LC_ALL=C screen -D -m sh -c "promiseutil -C array -a list -v >$tmp2"
+ grep -A8 '^LdId' "$tmp2" | grep '^[0-9]' >"$tmp"
if [ $? -eq 0 ]; then
# Promise Hardware-RAID detected
declare -i good=0
if [ $? -eq 0 ]; then
# Promise Hardware-RAID detected
declare -i good=0
TEXT="$TEXT Promise HW-RAID status is unknown ($status)!?"
fi
fi
TEXT="$TEXT Promise HW-RAID status is unknown ($status)!?"
fi
fi
elif [ `uname` = "Linux" -a -r /proc/mdstat ]; then
status=$(cat /proc/mdstat | grep -E "(^md|^ [0-9])" \
| while read info1; do
elif [ `uname` = "Linux" -a -r /proc/mdstat ]; then
status=$(cat /proc/mdstat | grep -E "(^md|^ [0-9])" \
| while read info1; do