#!/usr/bin/env /lib/runit/invoke-run
set -e

NAME=rc-local

exec 2>&1

if [ ! -e $HOME/.runit/service/$NAME/supervise/oneshot-up ]; then
echo "Starting $NAME..."
sh -c "$HOME/.runit/rc.local" && ls -1 $HOME/.runit/rc-local/*.start  |  while read script; do sh -c $script;  done;
touch $HOME/.runit/service/$NAME/supervise/oneshot-up
fi

chpst -b pause -- "$0"
