使用选项-D -R SessionName时屏幕消息“必须连接到终端”

问题描述 投票:1回答:1

我在bash中有脚本检查mp4文件,如果找到多个,它会逐个开始播放。

当我通过ssh登录时,脚本从命令行工作。

但是当我重新启动rpi时,它不会以rc.local中的autostart开头说

“必须连接到终端”

这是脚本的一部分

    if [ "$count_dir_video" -gt "1"  ] ;then
 53 
 54                 # make background black to hide wallpaper between videos
 55                 DISPLAY=:0 screen -dmS "black_background" feh -FxYqZ /opt/scripts/black_background.jpg
 56                 echo "przed sleep"
 57                 #screen -dmS "$1" sleep 5
 58                 echo "po sleep"
 59 
 60                         while :
 61                         do
 62                                 for entry in $root_dir_video
 63                                 do
 64 
 65                                 # multiple files
 66                                 echo "przed omx"
 67                                 screen -D -R "$1" omxplayer -o hdmi -p -b --no-osd --vol 100 "$entry" >> /var/log/sds.log
 68                                 echo "po omx"
 69                                 done
 70                         done
 71                 else
 72 
 73                         # single file
 74 
 75                         screen -dmS "$1" omxplayer -o hdmi -p -b --loop --no-osd --vol 100 "$root_dir_video"
 76                 fi

问题出在第67行,我无法使其发挥作用。

我尝试了其他参数屏幕组合但始终相同。

这个想法是它将在一次命名的屏幕会话中启动每个条目。

linux bash raspberry-pi2 gnu-screen autostart
1个回答
0
投票

男人的屏幕

   -D -R   Attach here and now. In detail this means: If a session is run‐
           ning, then reattach. If necessary detach  and  logout  remotely
           first.   If  it  was not running create it and notify the user.
           This is the author's favorite.

使用小写的-d-m

© www.soinside.com 2019 - 2024. All rights reserved.