reads TPOT_TYPE variable from .env, and copies the appropriate file from compose to docker-compose.yml

This commit is contained in:
Daniel Ortiz 2025-07-04 21:12:54 -04:00
parent b348734403
commit 2a0efff631

View file

@ -18,6 +18,11 @@ myUPDATER=$(cat << "EOF"
EOF
)
if [[ -n "$2" ]]; then
TPOT_TYPE=$2
echo "[ $myGREEN"Starting update procedure ARGS for T-Pot $TPOT_TYPE ... "$myWHITE ]"
fi
# Check if running with root privileges
if [ ${EUID} -eq 0 ];
then
@ -67,7 +72,13 @@ function fuSELFUPDATE () {
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
git reset --hard
git pull --force
if [ -z "$TPOT_TYPE" ]; then
exec ./update.sh -y
else
exec ./update.sh -y $TPOT_TYPE
fi
exit 1
else
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
@ -210,6 +221,7 @@ function fuRESTORE () {
}
function fuGETTPOTTYPE () {
if [ -z "$TPOT_TYPE" ]; then
if [ -f .env ]; then
TPOT_TYPE=$(grep "^TPOT_TYPE=" .env | cut -d'=' -f2-)
if [ -z "$TPOT_TYPE" ]; then
@ -219,7 +231,8 @@ function fuGETTPOTTYPE () {
else
TPOT_TYPE=HIVE
fi
echo "[ $myGREEN"Starting update procedure for T-Pot $TPOT_TYPE ... "$myWHITE ]"
echo "[ $myGREEN"Starting update procedure fuGETTPOTTYPE for T-Pot $TPOT_TYPE ... "$myWHITE ]"
fi
}
################
@ -239,9 +252,11 @@ if [ "$1" != "-y" ]; then
exit
fi
fuGETTPOTTYPE
fuCHECK_VERSION
fuCHECKINET "https://index.docker.io https://github.com"
fuGETTPOTTYPE
fuSTOP_TPOT
fuBACKUP
fuSELFUPDATE "$0" "$@"