b18f2651ac
The committed port is an improved and updated version of the submitted one, thanks to Stefan (Racke) Hornburg <racke@linuxia.de> for his helpful hints about some configure/build internals of interchange. I decided to take over maintainership of this port for a while until someone more responsive than the port submitter (no answer so far from him since I decided to take over the PR) is interested in it or until I think the testing period of this port is over. PR: 41390 Submitted by: Seth Kingsley <sethk@meowfishies.com> Thanks to: Stefan (Racke) Hornburg <racke@linuxia.de>
35 lines
835 B
Bash
35 lines
835 B
Bash
#!/bin/sh
|
|
|
|
RUNDIR=/var/run/interchange
|
|
LOGDIR=/var/log/interchange
|
|
ICUSER=$(cat %%PREFIX%%/interchange/_uid)
|
|
PIDFILE=${RUNDIR}/interchange.pid
|
|
SOCKFILE=${RUNDIR}/interchange.sock
|
|
|
|
OPTS="SocketFile=${SOCKFILE} IPCsocket=${SOCKFILE}.ipc PIDfile=${PIDFILE}"
|
|
OPTS="${OPTS} --pidfile=${PIDFILE} --log=${LOGDIR}/error.log --rundir=${RUNDIR}"
|
|
|
|
case "$1" in
|
|
start)
|
|
[ -d ${RUNDIR} ] || \
|
|
(mkdir ${RUNDIR} && chown ${ICUSER}:${ICUSER} ${RUNDIR})
|
|
[ -d ${LOGDIR} ] || \
|
|
(mkdir ${LOGDIR} && chown ${ICUSER}:${ICUSER} ${LOGDIR})
|
|
|
|
if [ -x %%PREFIX%%/bin/interchange ]; then
|
|
su -m ${ICUSER} \
|
|
-c "%%PREFIX%%/bin/interchange ${OPTS} >/dev/null" && \
|
|
echo -n ' interchange'
|
|
fi
|
|
;;
|
|
stop)
|
|
if [ -r ${PIDFILE} ]; then
|
|
kill $(cat ${PIDFILE}) && \
|
|
echo -n ' interchange'
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: `basename $0` {start|stop}" >&2
|
|
;;
|
|
esac
|
|
|