#!/bin/sh

# Restarts the darkbot process referenced by darkbot.pid. (only for unix)

# Copyright (C) 1996 Darkbot Project.

# This program is free software, you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2.  This
# program is distributed in the hope that it will be useful, but without
# any warranty, without even the implied warranty of merchantability or
# fitness for a particular purpose.  See the COPYING file for details.
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
PIDFILE="$SCRIPT_DIR/../darkbot.pid"

if [ ! -r "$PIDFILE" ]; then
	echo "restart.darkbot: missing pid file: $PIDFILE" >&2
	exit 1
fi

kill -HUP "$(cat "$PIDFILE")"
