forked from foospidy/HoneyPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhoneypyd
executable file
·51 lines (48 loc) · 1.32 KB
/
honeypyd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# honeypyd
#
# This script can be used to start HoneyPy in daemon mode when your system boots.
# Note: this has been tested on Debian (Jessie).
#
# Instructions (need to be executed with root):
# - Copy this file to /etc/init.d/honeypyd
# - Set the HONEYPY_USER variable below to a user account to run HoneyPy as (do not use root!).
# - Set the HONEYPY_HOME variable below to the absolute path to your HoneyPy directory.
# - Run update-rc.d honeypyd defaults
# HoneyPy will now start in daemon mode on boot.
#
# Manually start/stop
# - /etc/init.d/honeypyd start
# - /etc/init.d/honeypyd stop
#
# To remove honeypyd from starting on boot:
# - update-rc.d -f honeypyd remove
#
HONEYPY_USER='<Enter run user here>'
HONEYPY_HOME='<Enter path to HoneyPy directory here>'
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting HoneyPy..."
su -c ${HONEYPY_HOME}'/Honey.py -d &' ${HONEYPY_USER}
;;
stop)
echo "Stopping HoneyPy"
pid=`ps -ef | grep "Honey.py -d" | grep -v grep | awk '{ print $2 }'`
kill -9 $pid
;;
status)
pid=`ps -ef | grep "Honey.py -d" | grep -v grep | awk '{ print $2 }'`
if [ -z $pid ];
then
exit 5;
else
exit 0;
fi
;;
*)
echo "Usage: /etc/init.d/honeypyd {start|stop|status}"
exit 1
;;
esac
exit 0