最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

firefox - Check if Steam Link is running on Raspberry Pi 5 - Stack Overflow

programmeradmin9浏览0评论

I want a script that checks if steam link is running on my raspberry pi 5 with raspberry OS.

Hi all,

I wrote a script that should check if steam link is running. If it runs the script should stop xboxdrv. If steam link is stopped xboxdrv should start again. This is my attempt:

process_string="steamlink"
while true
do

if pgrep -x "$process_sring">/dev/null
        then
                echo "running"
                if pgrep -x "xboxdrv">/dev/null
                then
                        echo "stopping xboxdrv"
                        pkill -x "xboxdrv"
                fi
        else
                echo "stopped"
                if ! pgrep -x "xboxdrv">/dev/null
                        echo "start xboxdrv"
                        xboxdrv --detach-kernel-driver --silent --mouse &
                fi
        fi
        sleep 3
done

When I type in firefox as the process string it works. It starts and stops with firefox. I guess I'm using the wrong process name but I can't find anything online. What can I do to make it work?

Thanks in advance for your answers.

发布评论

评论列表(0)

  1. 暂无评论