Skip to content
Browse files

Initial commit of debian startup-scripts

  • Loading branch information...
1 parent 9c6bd34 commit 2fbc1b1ba5d8bc74a7ee57c677280147f4827ddf gamelinux committed Jan 1, 2013
Showing with 109 additions and 0 deletions.
  1. +44 −0 etc/default-debian
  2. +65 −0 init.d/passivedns-debian
View
44 etc/default-debian
@@ -0,0 +1,44 @@
+# OPTIONS:
+#
+# -i <iface> Network device <iface> (default: eth0).
+# -r <file> Read pcap <file>.
+# -l <file> Name of the logfile (default: /var/log/passivedns.log).
+# -L <file> Name of NXDOMAIN logfile (default: /var/log/passivedns.log).
+# -b 'BPF' Berkley Packet Filter (default: 'port 53').
+# -p <file> Name of pid file (default: /var/run/passivedns.pid).
+# -S <mem> Soft memory limit in MB (default: 256).
+# -C <sec> Seconds to cache DNS objects in memory (default 43200).
+# -P <sec> Seconds between printing duplicate DNS info (default 86400).
+# -X <flags> Manually set DNS RR Types to care about(Default -X 46CDNPRS).
+# -u <uid> User ID to drop privileges to.
+# -g <gid> Group ID to drop privileges to.
+# -T <dir> Directory to chroot into.
+# -D Run as daemon.
+# -V Show version and exit.
+# -h This help message.
+#
+# FLAGS:
+#
+# 4:A 6:AAAA C:CNAME D:DNAME N:NAPTR O:SOA
+# P:PTR R:RP S:SRV T:TXT M:MX n:NS
+# x:NXD
+#
+## Default values
+NAME=passivedns
+PIDFILE=/var/run/passivedns.pid
+DAEMON=/usr/bin/$NAME
+
+## Quick and dirty:
+INTERFACE="-i eth0"
+LOGFILE="-l /var/log/passivedns.log"
+NXLOGFILE="-L /var/log/passivedns-nx.log"
+MAXMEM="-S 256"
+PRINT="-P 86400"
+RRTYPES="-X 46CDNOPRSTMnx"
+#UID="-u 1"
+#GID="-g 1"
+#CHROOT="/usr/lib/passivedns/"
+DEAMON="-D"
+ARGS="$INTERFACE $LOGFILE $NXLOGFILE $MAXMEM $PRINT $RRTYPES $DEAMON"
+
+
View
65 init.d/passivedns-debian
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: passivedns
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Passive DNS collector
+# Description: This is a network (security) tool designed to
+# collect DNS information for troubleshooting or
+# security related work
+### END INIT INFO
+
+NAME=passivedns
+PIDFILE=/var/run/passivedns.pid
+DAEMON=/usr/bin/$NAME
+ARGS="-i eth0 -D"
+
+# Source default configs.
+if [ -r /etc/default/passivedns ]; then
+ . /etc/default/passivedns
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ echo -n "Starting $NAME ..."
+ $DAEMON $ARGS 2>&1 &
+ echo " done."
+ ;;
+ stop)
+ echo -n "Stopping $NAME ..."
+ start-stop-daemon --oknodo --stop --quiet --pidfile=$PIDFILE --exec $DAEMON
+ echo " done."
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ if [ -f $PIDFILE ]; then
+ PID=`cat $PIDFILE`
+ ps -p $PID > /dev/null 2>&1
+ RC=$?
+ if [ "$RC" == "0" ]; then
+ echo "PassiveDNS is running with PID $PID..."
+ else
+ echo "PassiveDNS is not running..."
+ fi
+ else
+ echo "PassiveDNS is not running..."
+ fi
+ ;;
+ force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload|status}"
+ exit 1
+esac
+
+exit 0
+

0 comments on commit 2fbc1b1

Please sign in to comment.
Something went wrong with that request. Please try again.