mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-08-23 11:26:55 +00:00
reads TPOT_TYPE variable from .env, and copies the appropriate file from compose to docker-compose.yml
This commit is contained in:
parent
b348734403
commit
2a0efff631
1 changed files with 24 additions and 9 deletions
33
update.sh
33
update.sh
|
@ -18,6 +18,11 @@ myUPDATER=$(cat << "EOF"
|
||||||
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
|
# Check if running with root privileges
|
||||||
if [ ${EUID} -eq 0 ];
|
if [ ${EUID} -eq 0 ];
|
||||||
then
|
then
|
||||||
|
@ -67,7 +72,13 @@ function fuSELFUPDATE () {
|
||||||
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
echo "###### $myBLUE""Found newer version, will be pulling updates and restart myself.""$myWHITE"
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git pull --force
|
git pull --force
|
||||||
exec ./update.sh -y
|
|
||||||
|
if [ -z "$TPOT_TYPE" ]; then
|
||||||
|
exec ./update.sh -y
|
||||||
|
else
|
||||||
|
exec ./update.sh -y $TPOT_TYPE
|
||||||
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
echo "###### $myBLUE""Pulling updates from repository.""$myWHITE"
|
||||||
|
@ -210,16 +221,18 @@ function fuRESTORE () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fuGETTPOTTYPE () {
|
function fuGETTPOTTYPE () {
|
||||||
if [ -f .env ]; then
|
if [ -z "$TPOT_TYPE" ]; then
|
||||||
TPOT_TYPE=$(grep "^TPOT_TYPE=" .env | cut -d'=' -f2-)
|
if [ -f .env ]; then
|
||||||
if [ -z "$TPOT_TYPE" ]; then
|
TPOT_TYPE=$(grep "^TPOT_TYPE=" .env | cut -d'=' -f2-)
|
||||||
echo "TPOT_TYPE is not set in .env file. Defaulting to 'HIVE'"
|
if [ -z "$TPOT_TYPE" ]; then
|
||||||
|
echo "TPOT_TYPE is not set in .env file. Defaulting to 'HIVE'"
|
||||||
|
TPOT_TYPE=HIVE
|
||||||
|
fi
|
||||||
|
else
|
||||||
TPOT_TYPE=HIVE
|
TPOT_TYPE=HIVE
|
||||||
fi
|
fi
|
||||||
else
|
echo "[ $myGREEN"Starting update procedure fuGETTPOTTYPE for T-Pot $TPOT_TYPE ... "$myWHITE ]"
|
||||||
TPOT_TYPE=HIVE
|
|
||||||
fi
|
fi
|
||||||
echo "[ $myGREEN"Starting update procedure for T-Pot $TPOT_TYPE ... "$myWHITE ]"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################
|
################
|
||||||
|
@ -239,9 +252,11 @@ if [ "$1" != "-y" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fuGETTPOTTYPE
|
||||||
fuCHECK_VERSION
|
fuCHECK_VERSION
|
||||||
fuCHECKINET "https://index.docker.io https://github.com"
|
fuCHECKINET "https://index.docker.io https://github.com"
|
||||||
fuGETTPOTTYPE
|
|
||||||
fuSTOP_TPOT
|
fuSTOP_TPOT
|
||||||
fuBACKUP
|
fuBACKUP
|
||||||
fuSELFUPDATE "$0" "$@"
|
fuSELFUPDATE "$0" "$@"
|
||||||
|
|
Loading…
Reference in a new issue