#!/bin/sh

pr=/usr/local/sbin/PortRedirector
device=ttyq0
host=my.remote.host
port=2001
pidfile=/var/run/$pr-$device.pid

case "$1" in
start)
    if [ -x $pr ]; then
	/usr/bin/perl $pr $device $host $port
	echo -n ' PortRedirector'
    fi
    ;;
stop)
    if [ -f $pidfile ]; then
	kill `cat $pidfile`
	echo -n ' PortRedirector'
    else
	echo ' PortRedirector: not running'
    fi
    ;;
*)
    echo "Usage: `basename $0` {start|stop}" >&2
    exit 64
    ;;
esac

exit 0
