我喜欢在启动时启动我的Raspberry Pi上的Siriproxy服务器。 我必须打字
cd siriproxy
rvmsudo siriproxy server
在terminal上启动Siriproxy。 有没有办法在启动时运行命令?
非常感谢,
大卫
这是我编辑的脚本:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi #I added this line /home/pi/siriproxy server exit 0 /etc/init.d/cron start
您可以将以root身份运行的命令添加到/etc/rc.local脚本中,然后在启动时运行它们。 ( http://ubuntuforums.org/showthread.php?t=1822137 )
从你的覆盆子pi的终端,运行:
sudo nano /etc/rc.local
在退出0行之前添加以下内容:
/path/to/siriproxy server
您可以通过键入来获得siriproxy的路径
which siriproxy
或者根据你的pi安装siriproxy的方式,它可能是你cd到的完整路径,然后添加“siriproxy”到最后。
保存文件,并重新启动,看看它的工作! 希望这有助于。
尝试
screen -S ttlp cd /home/pi/siriproxy
然后
rvm siriproxy server
我还没有尝试过,我会把它安装在我的一个Pi上,帮助你。
问候,IC0NIC