Difference between revisions of "ChaosVPN:Tims NetBSD chaosvpn rc.d"

From CCCHHWiki
Jump to: navigation, search
m
m
Line 26: Line 26:
  
 
   echo "Killing ChaosVPN..."
 
   echo "Killing ChaosVPN..."
   ps -aux | awk '/chaosvpn/ && !/awk/ {print $2}' | xargs -r kill -9
+
   ps -aux | awk '/chaosvpn -d/ && !/awk/ {print $2}' | xargs -r kill -9
 
   sleep 2 # once again, let things die...
 
   sleep 2 # once again, let things die...
 
   echo "Killing tincd..."
 
   echo "Killing tincd..."

Revision as of 06:58, 24 October 2013

#!/bin/sh
#
# $NetBSD: chaosvpn
# 

# PROVIDE: chaosvpn
# REQUIRE: inetd network LOGIN

$_rc_subr_loaded . /etc/rc.subr

name="chaosvpn"
start_cmd="chaosvpn_start"
stop_cmd="chaosvpn_stop"

chaosvpn_start(){

  /usr/local/sbin/chaosvpn -d

  #add logic in here later to check if its actually up
  #for now just assume it worked, lol
  echo "chaosvpn up..."
}

chaosvpn_stop(){

  echo "Killing ChaosVPN..."
  ps -aux | awk '/chaosvpn -d/ && !/awk/ {print $2}' | xargs -r kill -9
  sleep 2 # once again, let things die...
  echo "Killing tincd..."
  ps -aux | awk '/tincd/ && !/awk/ {print $2}' | xargs -r kill -9

  #add logic in here later to check if its actually down
  echo "chaosvpn down..."
}

run_rc_command "$1"
# eof