#!/bin/sh

# might be called before /etc/profile ??? so define here
BINDIR="/usr/local/bin"
RUNDIR="/var/tmp/imp3sh"
CONFIGDIR="/usr/local/share/imp3sh"

# Make sure not currently running
killall -q -KILL imp3sh
rm      -rf $RUNDIR	

# Create new working dir
mkdir         $RUNDIR
mkfifo        $RUNDIR/in
mkfifo        $RUNDIR/out
echo "1" >    $RUNDIR/running
chmod -R 0777 $RUNDIR

# Start imp3sh and pass arguments
$BINDIR/imp3sh -noexec -r $CONFIGDIR/rc -i $RUNDIR/in -o $RUNDIR/out &

exit 0
