From 58713e9b840f7c225221b5f2cc013cce1d864dc8 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Wed, 2 Feb 2022 00:10:19 +0000 Subject: [PATCH] Check if username tpot exists for post install Abort installation in case the user exists --- README.md | 2 ++ iso/installer/install.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index c053a3d4..b2042c5c 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,8 @@ In some cases it is necessary to install Debian 10 (Buster) on your own: The T-Pot Universal Installer will upgrade the system and install all required T-Pot dependencies. +Important notice: The user / group `tpot` are reserved for T-Pot. The installation will abort if the user `tpot` exists. Make sure to use a different user name when preparing the OS installation for T-Pot. + Just follow these steps: ``` diff --git a/iso/installer/install.sh b/iso/installer/install.sh index a988ab22..57a478d7 100755 --- a/iso/installer/install.sh +++ b/iso/installer/install.sh @@ -436,6 +436,16 @@ if [ -s "$myTPOT_CONF_FILE" ] && [ "$myTPOT_CONF_FILE" != "" ]; fi # Prepare running the installer +myUSERCHECK=$(grep "tpot" /etc/passwd | wc -l) +if [ "$myUSERCHECK" -gt "0" ]; + then + echo "### The user name \"tpot\" already exists. The tpot username and group may not previously exist or T-Pot will not work." + echo "### We recommend a fresh install according to the T-Pot Readme Post-Install method." + echo + echo "Aborting." + echo + exit 0 +fi echo "$myINFO" | head -n 3 fuCHECK_PORTS