找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1238|回复: 6

怎么让命令开机执行呀

[复制链接]
发表于 2020-1-23 19:45 | 显示全部楼层 |阅读模式
我把这个https://github.com/ginuerzh/gost/releases/tag/v2.9.1解压后放在了根目录自建的opt目录下,然后用putty直接执行
/opt/gost/gost -C /opt/gost/gost.json >/dev/null &命令可以正常启动,可是我把这个命令放在启动项哪里的本地脚本下重启却没有执行,这个要咋解决呀?谢谢
我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-1-23 19:57 | 显示全部楼层
/etc/storage/started_script.sh 我记得是这个然后ssh进去输入 mtd_storage.sh save 也就是再次保存这个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-23 20:21 | 显示全部楼层
SSH进去打命令设置一下文件的权限
chmod +x /opt/gost/gost
然后重启一下试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-23 20:24 | 显示全部楼层
在exit 0之前填上

  1. sleep 10
  2. /opt/gost/gost -C /opt/gost/gost.json >/dev/null &
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-1-23 21:05 | 显示全部楼层
99010 发表于 2020-1-23 20:24
在exit 0之前填上

好像也没用,因为我用putty输入/opt/gost/gost -C /opt/gost/gost.json >/dev/null &后会显示开启6688端口,如果我再次输入/opt/gost/gost -C /opt/gost/gost.json >/dev/null &的话会提示address already in use,但是添加/opt/gost/gost -C /opt/gost/gost.json >/dev/null &到exit0前,然后重启,也在putty里面输入/opt/gost/gost -C /opt/gost/gost.json >/dev/null &并不会提示address already in use,而是提示6688端口开启,说明本地脚本没有运行

点评

你这个要开机加载完后再运行的,可以试试计划任务  详情 回复 发表于 2020-1-24 07:04
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-24 07:04 来自手机 | 显示全部楼层
meizabc 发表于 2020-1-23 21:05
好像也没用,因为我用putty输入/opt/gost/gost -C /opt/gost/gost.json >/dev/null &后会显示开启6688端 ...

你这个要开机加载完后再运行的,可以试试计划任务
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-24 14:08 | 显示全部楼层
加入rc.local?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 10:06

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表