Shairport.config run_this_before_play_begins sudo 命令 Raspi

问题描述

我想在 shairplay.config 中使用 run_this_befor_play_begins 函数

我的目标是在建立 Airplay 连接后实现 bluealse 服务断开连接,因此您不能仅通过 Airplay 通过蓝牙将音乐发送到 Raspi。然后Airplay断开连接,你可以用蓝牙重新连接。?

我已经尝试给出一个像 /etc/bt_end 这样的应用程序路径并写入其中

#!/bin/bash -e
    
sudo service bluealsa-aplay stop

在设置中我设置了这个

sessioncontrol = {
  run_this_before_play_begins = "/etc/bt_end";
  run_this_after_play_ends = "/etc/bt_start";
  wait_for_completion = "yes";
  session_timeout = 20;
};

我也试图用这个命令直接停止 bluealse 服务,这也没有帮助

run_this_after_play_start = "/usr/bin/sudo service bluealsa-aplay stop";

我只想运行 sudo 命令 sudo service bluealsa-aplay stop,但不知道如何实现。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)