Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # initial boot
- cd /storage/steamlink/ || exit 1
- [ -f /tmp/launch_steamlink ] && rm -f /tmp/launch_steamlink
- while true; do
- if [ -f /tmp/launch_steamlink ]; then
- rm -f /tmp/launch_steamlink
- if [ ! -z "$(pidof kodi)" ]; then
- systemctl stop kodi
- while pidof kodi &>/dev/null; do sleep 1; done
- fi
- if [ -z "$(pidof kodi)" ] && [ -z "$(pidof shell)" ]; then
- # kodi stopped and steamlink not running
- /storage/steamlink/steamlink.sh
- while pidof shell &>/dev/null; do sleep 1; done
- fi
- if [ -z "$(pidof kodi)" ] && [ -z "$(pidof shell)" ]; then
- # both stopped, restart kodi
- systemctl start kodi
- fi
- fi
- sleep 1
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement