1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-18 05:13:56 +02:00
openwrt-packages/net/redsocks/files/redsocks.init
Johannes Morgenroth 8c0260db9e redsocks: add new package
Redsocks is a daemon running on the local system, that will transparently
tunnel any TCP connection via a remote SOCKS4, SOCKS5 or HTTP proxy server. It
uses the system firewall's redirection facility to intercept TCP connections,
thus the redirection is system-wide, with fine-grained control, and does
not depend on LD_PRELOAD libraries.

Signed-off-by: Johannes Morgenroth <jm@m-network.de>
2015-02-22 17:11:33 +01:00

37 lines
638 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=90
# check if configuration exists
[ -e "/etc/redsocks.conf" ] || exit 0
start() {
if [ -e "/var/run/redsocks.pid" ]; then
echo "redsocks is already running"
exit 0
fi
/bin/echo -n "running redsocks ..."
# startup the safety-wrapper for the daemon
/usr/sbin/redsocks -p /var/run/redsocks.pid
/bin/echo " done"
}
stop() {
if [ ! -e "/var/run/redsocks.pid" ]; then
echo "redsocks is not running"
exit 0
fi
/bin/echo -n "stopping redsocks ..."
# kill the process
/bin/kill $(cat /var/run/redsocks.pid)
rm /var/run/redsocks.pid
echo " done"
}