#!/bin/sh

# Smoke test to get simple text output from mumble and murmurd to insure
# that binaries are built and installed in place

set -e

MUMBLE_VERSION=$(/usr/bin/mumble -h | head -n 1 | grep "Usage: mumble")
MURMUR_VERSION=$(/usr/sbin/murmurd --version 2>&1| grep "/usr/sbin/murmurd")

if [ -n "$MUMBLE_VERSION" ] ; then
   echo "Found: $MUMBLE_VERSION"
else
   echo "Error: Mumble version found: $MUMBLE_VERSION" >&2
   exit 1
fi
if [ -n "$MURMUR_VERSION" ] ; then
   echo "Found: $MURMUR_VERSION"
else
   echo "Error: Murmur version found: $MURMUR_VERSION" >&2
   exit 1
fi
# If script gets to this point, smoke tests pass
echo "Smoke test passed."
exit 0
