#!/bin/sh

[ -f /usr/local/epics/base/lib/epics-setup.sh ] || exit 0
. /usr/local/epics/base/lib/epics-setup.sh

[ -f /usr/local/i386-glibc22-linux/cdev-1.7.2n/lib/cdev-setup.sh ] || exit 0
. /usr/local/i386-glibc22-linux/cdev-1.7.2n/lib/cdev-setup.sh

PATH=$CDEV/bin/$SYSNAME:$CDEV/sbin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export PATH

[ -f `which rsvcServer` ] || exit 0
[ -f /var/log/cdevGateway.log ] || exit 0

if [ "`whoami`" = "nobody" ] ;then
  export CDEV_NAME_SERVER=`hostname -s`
  rsvcServer </dev/null >>/var/log/cdevGateway.log 2>&1 &
  echo -n $!
fi

exit 0
