+++ /dev/null
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# protocols ofbsproxy will obfuscate = obfs2 | dummy
-PROTOCOL="obfs2"
-
-#options for PROTOCOLE="dummy"
-# dummy <mode> <listen_address> [<target_address>]
-# mode ~ server|client|socks
-# listen_address, target_address ~ host:port
-# target_address is required for server and client mode, and forbidden for socks mode.
-# Examples:
-# obfsproxy dummy socks 127.0.0.1:5000
-# obfsproxy dummy client 127.0.0.1:5000 192.168.1.99:11253
-# obfsproxy dummy server 192.168.1.99:11253 127.0.0.1:9005
-
-#MODE="socks"
-#LISTEN="127.0.0.1:5000"
-#TARGET="127.0.0.1:9005"
-
-
-#options for PROTOCOL="obfs2"
-# obfs2 [obfs2_args] obfs2_opts
-# 'obfs2_opts':
-# mode ~ server|client|socks
-# listen address ~ host:port
-# 'obfs2_args':
-# Destination Address ~ --dest=host:port
-# Shared Secret ~ --shared-secret=<secret>
-# Example:
-# obfsproxy obfs2 --dest=127.0.0.1:666 --shared-secret=himitsu server 127.0.0.1:1026
-
-MODE="server"
-DESTINATION="127.0.0.1:666"
-SECRET="changeme"
-LISTEN="127.0.0.1:1026"
-
-#Logging
-# --log-file=<file> ~ set logfile
-# --log-min-severity=warn|notice|info|debug ~ set minimum logging severity (default: notice)
-# --no-log ~ disable logging
-# --no-safe-logging ~ disable safe (scrubbed address) logging
-
-LOGGING="--log-file=/var/log/obfsproxy.log --log-min-severity=warn"
+++ /dev/null
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-PIDFILE="/var/run/obfsproxy.pid"
-DAEMON="/usr/bin/obfsproxy"
-
-depend() {
- need net
-}
-
-checkconfig() {
- [[ "x${PROTOCOL}" = "x" ]] \
- && eerror "PROTOCOL not given" && return 1
- [[ "x${MODE}" = "x" ]] \
- && eerror "MODE not given" && return 1
- if [ ${PROTOCOL} = "dummy" ] ; then
- [[ "x${LISTEN}" = "x" ]] \
- && eerror "No listen address was given" && return 1
- [[ "x${MODE}" = "xserver" && "x${TARGET}" = "x" ]] \
- && eerror "MODE=server but no target address was given" && return 1
- [[ "x${MODE}" = "xsocks" && "x${TARGET}" != "x" ]] \
- && eerror "MODE=sock but a target address was given" && return 1
- CMDLINE="${LOGGING} ${PROTOCOL} ${MODE} ${LISTEN} ${TARGET}"
- elif [ ${PROTOCOL} = "obfs2" ] ; then
- [[ "x${MODE}" = "xsocks" && "x${DESTINATION}" != "x" ]] \
- && eerror "MODE=sock but a destination address was given" && return 1
- [[ "x${LISTEN}" = "x" ]] \
- && eerror "LISTEN host:port was not given" && return 1
- [[ "x${DESTINATION}" != "x" ]] \
- && DESTINATION="--dest=${DESTINATION}"
- [[ "x${SECRET}" != "x" ]] \
- && SECRET="--shared-secret=${SECRET}"
- CMDLINE="${LOGGING} ${PROTOCOL} ${DESTINATION} ${SECRET} ${MODE} ${LISTEN}"
- else
- eerror "Unknown protocol ${PROTOCOL}"
- return 1
- fi
- return 0
-}
-
-start() {
- checkconfig || return 1
- ebegin "Starting obfsproxy server"
- start-stop-daemon --start \
- --background --make-pidfile --pidfile ${PIDFILE} \
- --exec ${DAEMON} -- ${CMDLINE}
- eend $?
-}
-
-stop() {
- ebegin "Stopping obfsproxy server"
- start-stop-daemon --stop \
- --pidfile ${PIDFILE} \
- --exec ${DAEMON}
- eend $?
-}