#!/bin/sh

source /etc/utils/shell-utils.sh

function is_process_running() {
    # $1 - process name
    [ "" == "`pgrep $1`" ]
}

# terminate the initramfs splash process and wait while it's gone
echo "killall splash"
killall splash
until is_process_running "stbapp"; do
    echo "splash is still running";
    sleep 0.1;
done

log "/dev/fb0 found! Starting splash utility..."
source /etc/init.d/splashfb start
