forked from cowrie/cowrie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·43 lines (36 loc) · 1.04 KB
/
start.sh
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
#!/bin/sh
AUTHBIND_ENABLED=no
COWRIEDIR=$(dirname $0)
PIDFILE="var/run/cowrie.pid"
export PYTHONPATH=${PYTHONPATH}:${COWRIEDIR}
#Change the below to -n to disable daemonizing (for instance when using supervisor)
DAEMONIZE=""
echo
echo 'WARNING: start.sh is deprecated and will be removed in the future.'
echo 'WARNING: you can start cowrie with "bin/cowrie start"'
echo
set -e
cd ${COWRIEDIR}
if [ "$1" != "" ]
then
VENV="$1"
if [ ! -d "$VENV" ]
then
echo "The specified virtualenv \"$VENV\" was not found!"
exit 1
fi
if [ ! -f "$VENV/bin/activate" ]
then
echo "The specified virtualenv \"$VENV\" was not found!"
exit 2
fi
echo "Activating virtualenv \"$VENV\""
. $VENV/bin/activate
fi
echo "Starting cowrie with extra arguments [$XARGS $DAEMONIZE] ..."
if [ $AUTHBIND_ENABLED = "no" ]
then
twistd $XARGS $DAEMONIZE -l log/cowrie.log --umask 0077 --pidfile ${PIDFILE} cowrie
else
authbind --deep twistd $DAEMONIZE $XARGS -l log/cowrie.log --umask 0077 --pidfile ${PIDFILE} cowrie
fi