From 84e726895c196bcf6609bae7c26acfe3ee253034 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Tue, 5 May 2020 12:33:52 +0800 Subject: [PATCH] add warning for py2.7 (#1348) --- bin/cowrie | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/cowrie b/bin/cowrie index 8c8d6366..e89bddf8 100755 --- a/bin/cowrie +++ b/bin/cowrie @@ -24,6 +24,16 @@ first_time_use() { echo } +python_version_warning() { + echo "version check" + if python -V 2>&1 | grep -q '^Python 2.'; then + echo + echo "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020." + echo "Please upgrade your Python as Python 2.7 won't be maintained after that date. Cowrie has dropped support for Python 2.7." + echo + fi +} + migrate_userdb() { if [ -f ${COWRIEDIR}/data/userdb.txt ]; then echo "Migrating ${COWRIEDIR}/data/userdb.txt to ${COWRIEDIR}/etc/userdb.txt" @@ -100,6 +110,8 @@ cowrie_start() { echo 2>&1 "Not using Python virtual environment" fi + python_version_warning + # Automatically check if the authbind is enabled or not authfile="/etc/authbind/byport/22" if [ -z ${AUTHBIND_ENABLED} ] && [ -x "$authfile" ] && command -v authbind >/dev/null; then