add warning for py2.7 (#1348)

This commit is contained in:
Michel Oosterhof 2020-05-05 12:33:52 +08:00 committed by GitHub
parent b8e0df92f6
commit 84e726895c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -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