#!/bin/bash

/usr/bin/chpst -u mythtv /usr/bin/mythexport-daemon

PID=`pidof -o %PPID -x /usr/bin/mythexport-daemon`

# Wait until daemon dies, else runit can't supervise us
  while [ "`pidof -o %PPID -x /usr/bin/mythexport-daemon`" == "$PID" ]; do
    sleep 2
  done
