dlan        15/01/08 09:34:06

  Added:                shadowsocks.json shadowsocks.initd
  Log:
  initial version, borrow from gentoo-zh overlay, polished by me
  
  (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 
0xAABEFD55)

Revision  Changes    Path
1.1                  net-proxy/shadowsocks-libev/files/shadowsocks.json

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/shadowsocks-libev/files/shadowsocks.json?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/shadowsocks-libev/files/shadowsocks.json?rev=1.1&content-type=text/plain

Index: shadowsocks.json
===================================================================
{
        "server":"server ip",
        "server_port":8388,
        "local_port":1080,
        "password":"password",
        "timeout":600,
        "method":"aes-256-cfb"
}



1.1                  net-proxy/shadowsocks-libev/files/shadowsocks.initd

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/shadowsocks-libev/files/shadowsocks.initd?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/shadowsocks-libev/files/shadowsocks.initd?rev=1.1&content-type=text/plain

Index: shadowsocks.initd
===================================================================
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 
/var/cvsroot/gentoo-x86/net-proxy/shadowsocks-libev/files/shadowsocks.initd,v 
1.1 2015/01/08 09:34:06 dlan Exp $

SS_CONFIG="/etc/shadowsocks.json"

SS_PIDFILE="/run/shadowsocks.pid"

depend() {
    need net
}

checkconfig() {
    if [ ! -f ${SS_CONFIG} ]; then
        ewarn "${SS_CONFIG} does not exist."
    fi

    SS_SVCNAME="${RC_SVCNAME#*.}"
    case ${SS_SVCNAME} in
    client)
        SS_COMMAND="/usr/bin/ss-local"
        return 0
        ;;
    server)
        SS_COMMAND="/usr/bin/ss-server"
        return 0
        ;;
    *)
        eerror "please choose to run as server or client mode"
        eerror "  server: rc-update add shadowsocks.server default"
        eerror "  client: rc-update add shadowsocks.client default"
        return 1
        ;;
    esac
}

start() {
    checkconfig || return 1

    ebegin "Starting Shadowsocks: ${SS_SVCNAME} mode"
    start-stop-daemon --start --exec ${SS_COMMAND} \
    -- -c ${SS_CONFIG} -f ${SS_PIDFILE} >/dev/null 2>&1 &
    eend $?
}

stop() {
    ebegin "Stopping Shadowsocks"
    start-stop-daemon --stop --pidfile ${SS_PIDFILE}
    eend $?
}





Reply via email to