2015-02-26, 10:34
there is only one steam isnt it? I am trying to launch steam big picture.
Quote:while [ 1 ] # do forever
do
xid=`pgrep kodi` # capture the process id of kodi
sid=`pgrep steam` # capture the process id of steam
while [ "$xid" ] # do the following while the kodi pid still exists
do
xid=`pgrep kodi` # recapture the kodi pid
if [ -z "$xid" ] # test if kodi is still running
then
/usr/bin/kodi & # if not then run kodi
fi
sleep 5 # sleep for 5 seconds
done
while [ "$sid" ] # do the following while the steam pid still exists
do
sid=`pgrep steam` # recapture the steam pid
if [ -z "$sid" ] # test if steam is still running
then
/usr/bin/kodi & # if not then run kodi
xid=`pgrep kodi` # and capture the pid of kodi
fi
sleep 5 # sleep for 5 seconds
done
done &
Quote:while true; do
if $(pidof kodi.bin) (wiki); then
if $(pidof steam) (wiki); then
echo kodi running
else
echo kodi running
fi
else
if ! $(pidof steam) (wiki); then
echo steam running
else
/usr/bin/kodi
fi
fi
sleep 1
done
#!/bin/bash
until [[ ! $(pidof steam) ]] && [[ ! $(pidof kodi.bin) ]] ; do
echo sleeping
sleep 1
done
(2015-03-02, 23:08)teeedubb Wrote: I don't think that approach is very good - you might end up with 2 instances of kodi running at the same time or if kodi has hung it won't restart because the kodi process is still running. Better to map a 'close app' key on your remote which kills kodi (and emulators, Firefox etc) and restarts kodi. You can do that via irexec.