#!/bin/sh

set -e

PATH=/usr/sbin:$PATH
export PATH

at_exit() {
    echo "info: test exiting"
}

trap at_exit INT TERM EXIT

echo info: starting daemon

# Redirect stderr because no display causes something to emit
# "Unable to init server: Could not connect: Connection refused" to stderr
DISPLAY= isenkramd 2>&1 &

pid=$!

sleep 5

echo info: stopping daemon
kill $pid
