mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-05-02 05:08:51 +00:00
tweak update script
This commit is contained in:
parent
00dfa6e797
commit
f767c829e4
1 changed files with 29 additions and 29 deletions
58
update.sh
58
update.sh
|
@ -85,36 +85,7 @@ function fuSELFUPDATE () {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "###### Update script is already up-to-date."
|
echo "###### Update script is already up-to-date."
|
||||||
|
|
||||||
# Better safe than sorry
|
|
||||||
echo "###### Creating backup and storing it in /home/tsec"
|
|
||||||
tar cvfz /home/tsec/tpot_backup.tgz /opt/tpot
|
|
||||||
|
|
||||||
echo "###### Pulling updates"
|
|
||||||
git pull --force
|
git pull --force
|
||||||
|
|
||||||
echo "###### Getting the current install flavor"
|
|
||||||
myFLAVOR=$(head $myCONFIGFILE -n 1 | awk '{ print $3 }' | tr -d :'()':)
|
|
||||||
|
|
||||||
echo "###### Updating compose file"
|
|
||||||
case $myFLAVOR in
|
|
||||||
HP)
|
|
||||||
echo "###### Restoring HONEYPOT flavor installation."
|
|
||||||
cp $myCOMPOSEPATH/hp.yml $myCONFIGFILE
|
|
||||||
;;
|
|
||||||
Industrial)
|
|
||||||
echo "###### Restoring INDUSTRIAL flavor installation."
|
|
||||||
cp $myCOMPOSEPATH/industrial.yml $myCONFIGFILE
|
|
||||||
;;
|
|
||||||
Standard)
|
|
||||||
echo "###### Restoring TPOT flavor installation."
|
|
||||||
cp $myCOMPOSEPATH/tpot.yml $myCONFIGFILE
|
|
||||||
;;
|
|
||||||
Everything)
|
|
||||||
echo "###### Restoring EVERYTHING flavor installation."
|
|
||||||
cp $myCOMPOSEPATH/all.yml $myCONFIGFILE
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +113,33 @@ echo
|
||||||
echo "### Now stopping T-Pot"
|
echo "### Now stopping T-Pot"
|
||||||
systemctl stop tpot
|
systemctl stop tpot
|
||||||
|
|
||||||
|
# Better safe than sorry
|
||||||
|
echo "###### Creating backup and storing it in /home/tsec"
|
||||||
|
tar cvfz /home/tsec/tpot_backup.tgz /opt/tpot
|
||||||
|
|
||||||
|
echo "###### Getting the current install flavor"
|
||||||
|
myFLAVOR=$(head $myCONFIGFILE -n 1 | awk '{ print $3 }' | tr -d :'()':)
|
||||||
|
|
||||||
|
echo "###### Updating compose file"
|
||||||
|
case $myFLAVOR in
|
||||||
|
HP)
|
||||||
|
echo "###### Restoring HONEYPOT flavor installation."
|
||||||
|
cp $myCOMPOSEPATH/hp.yml $myCONFIGFILE
|
||||||
|
;;
|
||||||
|
Industrial)
|
||||||
|
echo "###### Restoring INDUSTRIAL flavor installation."
|
||||||
|
cp $myCOMPOSEPATH/industrial.yml $myCONFIGFILE
|
||||||
|
;;
|
||||||
|
Standard)
|
||||||
|
echo "###### Restoring TPOT flavor installation."
|
||||||
|
cp $myCOMPOSEPATH/tpot.yml $myCONFIGFILE
|
||||||
|
;;
|
||||||
|
Everything)
|
||||||
|
echo "###### Restoring EVERYTHING flavor installation."
|
||||||
|
cp $myCOMPOSEPATH/all.yml $myCONFIGFILE
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "### Now upgrading packages"
|
echo "### Now upgrading packages"
|
||||||
apt-get autoclean -y
|
apt-get autoclean -y
|
||||||
|
@ -185,4 +183,6 @@ echo "### Now starting T-Pot service"
|
||||||
systemctl start tpot
|
systemctl start tpot
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
echo "### If you made changes to tpot.yml please ensure to add them again."
|
||||||
|
echo "### We stored the previous version as backup in /home/tsec."
|
||||||
echo "### Done."
|
echo "### Done."
|
||||||
|
|
Loading…
Reference in a new issue