#!/bin/sh
# Script to restart EMG quickly and semi-nice
# Initiate shutdown, wait 3 seconds to allow unbind requests to be
# sent and then kill emgd process before starting it again

ulimit -c unlimited

emgd -stop &
sleep 3
pkill -9 -f "emgd\b"
sleep 1
emgd
echo "-----"
echo "emgd has been restarted"
echo "-----"

exit 0

