94f9e7ea34
Resolves: rhbz#2003007 Signed-off-by: David Cantrell <david.l.cantrell@gmail.com>
24 lines
509 B
Bash
Executable File
24 lines
509 B
Bash
Executable File
#!/bin/sh
|
|
|
|
PATH=/usr/bin
|
|
TMUX=/usr/bin/tmux
|
|
SESSION_NAME="$(basename $0 .sh)"
|
|
RET=0
|
|
|
|
echo -n "checking that ${TMUX} can start a new session with 'top'..."
|
|
|
|
${TMUX} new-session -d -s ${SESSION_NAME} 'top' || ( echo "FAIL" ; exit 1 )
|
|
|
|
TOPPID=$(pgrep -x top)
|
|
PGREPCODE=$?
|
|
if [ -z "${TOPPID}" ] || [ ${PGREPCODE} -ne 0 ]; then
|
|
RET=1
|
|
elif [ ! -d /proc/${TOPPID} ]; then
|
|
RET=1
|
|
fi
|
|
|
|
${TMUX} kill-session -t ${SESSION_NAME} || ( echo "FAIL" ; exit 1 )
|
|
|
|
[ ${RET} -eq 0 ] && echo "ok" || echo "FAIL"
|
|
exit ${RET}
|