Browse Source

Update shadowsocks.init

1.使用OpenWrt提供的service_start及service_stop函数控制服务开关
2.由service_start函数生成pid文件
3.改配置文件目录为/etc/shadowsocks.json
pull/50/head
南浦月 10 years ago
parent
commit
0ce9c15186
1 changed files with 6 additions and 6 deletions
  1. 12
      openwrt/files/shadowsocks.init

12
openwrt/files/shadowsocks.init

@ -2,15 +2,15 @@
# Copyright (C) 2006-2011 OpenWrt.org
START=95
STOP=95
SERVICE_USE_PID=1
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
start() {
echo "starting shadowsocks..."
/usr/bin/ss-local -c /etc/config/shadowsocks.json -f /var/run/shadowsocks.pid
service_start /usr/bin/ss-local -c /etc/shadowsocks.json
}
stop() {
echo "shadowsocks stopped."
kill -9 `cat /var/run/shadowsocks.pid`
service_stop /usr/bin/ss-local
}
Loading…
Cancel
Save