1.1 KiB
1.1 KiB
#杂七杂八常识
先确认,是进入管理员模式;
以自启frp内网穿透为例; 打开命令行工具,nano新建一个文本
nano seafile.sh
输入自启脚本,参考
以#!/bin/bash开头 中间写脚本内容 exit 0 结尾 注释信息不可少,不然不生效
#!/bin/bash
### BEGIN INIT INFO
# Provides: test
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start test
# Description: start test
### END INIT INFO
#此处编写脚本内容
cd /root/frp_0.27.0_linux_amd64/
nohup ./frps -c ./frps.ini
exit 0
保存修改,chmod设置权限
chmod 755 seafile.sh
移动脚本,到自启文件夹 /etc/init.d/
mv test.sh /etc/init.d/
将脚本添加到,启动脚本中
update-rc.d seafile.sh defaults
如果需要移除,该自启脚本; 跳转到该目录,然后remove相关指令即可
cd /etc/init.d
**update-rc.d -f seafile.sh remove**