3

我喜欢在启动时在我的 Raspberry Pi 上启动我的 Siriproxy 服务器。我必须输入

  1. cd siriproxy

  2. rvmsudo siriproxy server

在终端中启动 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
4

2 回答 2

2

尝试

screen -S ttlp
cd /home/pi/siriproxy

然后

rvm siriproxy server

我还没有尝试过,我会将它安装在我的一个 Pi 上并帮助你。

问候, IC0NIC

于 2013-05-09T17:49:51.197 回答
1

您可以将以 root 身份运行的命令添加到 /etc/rc.local 脚本中,然后它们将在启动时运行。(http://ubuntuforums.org/showthread.php?t=1822137

在您的树莓派终端上,运行:

sudo nano /etc/rc.local

在 exit 0 行之前添加以下内容:

/path/to/siriproxy server

您可以通过键入获取siriproxy的路径

which siriproxy

或者取决于您的 pi 如何安装 siriproxy,它可能是您 cd 到的任何内容的完整路径,然后在末尾添加“siriproxy”。

保存文件并重新启动以查看它的工作!希望这有帮助。

于 2013-05-09T06:05:30.030 回答