local mpilog=$TMP/mpi.log
local rc
- if [ "$MPI_USER" != root -a $mpirun ]; then
+ if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then
echo "+ chmod 0777 $MOUNT"
chmod 0777 $MOUNT
command="su $MPI_USER sh -c \"$command \""
ls -ald $MOUNT
echo "+ $command"
- eval $command 2>&1 > $mpilog || true
+ eval $command 2>&1 | tee $mpilog || true
rc=${PIPESTATUS[0]}
- if [ $rc -eq 0 ] && grep -q "p4_error: : [^0]" $mpilog ; then
+ if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then
rc=1
fi
- cat $mpilog
return $rc
}
do_rpc_nodes $list lst_setup
}
+###
+# short_hostname
+#
+# Passed a single argument, strips everything off following and includes the first period.
+# client-20.lab.whamcloud.com becomes client-20
+short_hostname() {
+ echo $(sed 's/\..*//' <<< $1)
+}
+