#!/usr/bin/env bash

# read helper functions
source "/usr/share/image-launch/functions"

# resolve path of the config file and load it
readConfig $1

# finally find the pid file
resolvePidFile

# read pid from pid file and kill process
PID=$(<"$PIDFILE")
kill $PID

# on normal exit delete the pid file
if [ $? == 0 ] ;
then
   rm $PIDFILE
fi
