mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-26 02:33:41 +00:00
Update shadowsocks.init
1.使用OpenWrt提供的service_start及service_stop函数控制服务开关 2.由service_start函数生成pid文件 3.改配置文件目录为/etc/shadowsocks.json
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user