资讯

展开

树莓派-设置开机启动项

作者:快盘下载 人气:

树莓派 设置开机启动项 (并托管后台自动运行)

  1. 开机自动挂载U盘 并托管后台
  2. 开机自动cpolar穿墙 并托管后台
  3. 开机自动执行特定脚本 并托管后台
pi;mini:~ $ cat /etc/rc.local
#!/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
; ;$_IP;
fi
# 开机自动挂载U盘 并托管后台
nohup sudo mount /dev/sda1 /mnt/usb1
# 开机自动cpolar穿墙 并托管后台
nohup /home/base/cpolar start-all -config=/home/pi/.cpolar/cpolar.yml -log=stdout &
# 开机自动执行特定脚本 并托管后台
nohup bash /home/work/mplayer/mvf_b.sh -log=stdout &
exit 0

加载全部内容

相关教程
猜你喜欢
用户评论
快盘暂不提供评论功能!