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
使用cpolar内网穿透发布树莓派网页:搭建web服务器-1/4