Add automatic authbind detection (#1047)

This commit is contained in:
Mehtab Zafar
2019-03-17 22:39:43 +05:30
committed by Michel Oosterhof
parent ab1355edf4
commit 6010a4c0b0

View File

@ -1,6 +1,4 @@
#!/bin/bash
#Change the below to yes if you are using authbind to listen to port 22
AUTHBIND_ENABLED=no
# To override the default virtual enviroment, either set COWRIE_VIRTUAL_ENV or
# activate it before starting Cowrie
@ -102,6 +100,14 @@ cowrie_start() {
echo 2>&1 "Not using Python virtual environment"
fi
#Automatically check if the authbind is enabled or not
authfile="/etc/authbind/byport/22"
if [ -x authfile ]; then
AUTHBIND_ENABLED=yes
else
AUTHBIND_ENABLED=no
fi
echo "Starting cowrie: [twistd ${TWISTEDARGS} cowrie ${COWRIEARGS}]..."
if [ "$AUTHBIND_ENABLED" = "no" ]
then