From: Alexander Barton Date: Wed, 22 Aug 2012 13:57:44 +0000 (+0200) Subject: RAID.tst: use screen(1) so that promiseutil(8) has a valid tty X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git;a=commitdiff_plain;h=6d47f0ea45dd85a336c88728094c19292c866c0d;ds=sidebyside RAID.tst: use screen(1) so that promiseutil(8) has a valid tty 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 ... --- diff --git a/client/lib/tests/RAID.tst b/client/lib/tests/RAID.tst index 51c785c..859062b 100644 --- a/client/lib/tests/RAID.tst +++ b/client/lib/tests/RAID.tst @@ -5,6 +5,7 @@ SERVICE="RAID_p" 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 @@ -46,8 +47,8 @@ if [ `uname` = "Darwin" ]; then TEXT="$TEXT Apple HW-RAID status is unknown ($status)!?" fi fi - LC_ALL=C promiseutil -C array -a list -v 2>/dev/null "$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 @@ -73,7 +74,7 @@ if [ `uname` = "Darwin" ]; then TEXT="$TEXT Promise HW-RAID status is unknown ($status)!?" fi fi - rm -f "$tmp" + rm -f "$tmp" "$tmp2" elif [ `uname` = "Linux" -a -r /proc/mdstat ]; then status=$(cat /proc/mdstat | grep -E "(^md|^ [0-9])" \ | while read info1; do