lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

redsocks.init (638B)


      1 #!/bin/sh /etc/rc.common
      2 # Copyright (C) 2007 OpenWrt.org
      3 
      4 START=90
      5 
      6 # check if configuration exists
      7 [ -e "/etc/redsocks.conf" ] || exit 0
      8 
      9 start() {
     10 	if [ -e "/var/run/redsocks.pid" ]; then
     11 		echo "redsocks is already running"
     12 		exit 0
     13 	fi
     14 
     15 	/bin/echo -n "running redsocks ..."
     16 	
     17 	# startup the safety-wrapper for the daemon
     18 	/usr/sbin/redsocks -p /var/run/redsocks.pid
     19 	
     20 	/bin/echo " done"
     21 }
     22 
     23 stop() {
     24 	if [ ! -e "/var/run/redsocks.pid" ]; then
     25 		echo "redsocks is not running"
     26 		exit 0
     27 	fi
     28 
     29 	/bin/echo -n "stopping redsocks ..."
     30 	
     31 	# kill the process
     32 	/bin/kill $(cat /var/run/redsocks.pid)
     33 	rm /var/run/redsocks.pid
     34 	
     35 	echo " done"
     36 }