tweak updater for 22.x update

This commit is contained in:
t3chn0m4g3 2022-03-18 18:17:12 +00:00
parent b7096d6df6
commit cbf431d960

View file

@ -3,6 +3,7 @@
# Some global vars # Some global vars
myCONFIGFILE="/opt/tpot/etc/tpot.yml" myCONFIGFILE="/opt/tpot/etc/tpot.yml"
myCOMPOSEPATH="/opt/tpot/etc/compose" myCOMPOSEPATH="/opt/tpot/etc/compose"
myLSB_RELEASE="bullseye"
myRED="" myRED=""
myGREEN="" myGREEN=""
myWHITE="" myWHITE=""
@ -86,10 +87,33 @@ local myMINVERSION="20.06.0"
local myMASTERVERSION="22.03.0" local myMASTERVERSION="22.03.0"
echo echo
echo "### Checking for Release ID" echo "### Checking for Release ID"
myRELEASE=$(lsb_release -i | grep Debian -c) myRELEASE=$(lsb_release -c | awk '{ print $2 }')
if [ "$myRELEASE" == "0" ] if [ "$myRELEASE" != "$myLSB_RELEASE" ]
then then
echo "###### This version of T-Pot cannot be upgraded automatically. Please run a fresh install.$myWHITE"" [ $myRED""NOT OK""$myWHITE ]" echo "###### Need to upgrade to Debian 11 (Bullseye) first:$myWHITE"" [ $myRED""NOT OK""$myWHITE ]"
echo "###### Upgrade may result in complete data loss and should not be run via SSH."
echo "###### If you installed T-Pot using the post-install method instead of the ISO it is recommended you upgrade manually to Debian 11 (Bullseye) and then re-run update.sh."
echo "###### Do you want to upgrade to Debian 11 (Bullseye) now?"
while [ "$myQST" != "y" ] && [ "$myQST" != "n" ];
do
read -p "Upgrade? (y/n) " myQST
done
if [ "$myQST" = "n" ];
then
echo $myGREEN"Aborting!"$myWHITE
exit
else
echo "###### Stopping and disabling T-Pot services ... "
systemctl stop tpot
systemctl disable tpot
echo "###### Switching /etc/apt/sources.list from buster to bullseye ... "
sed -i 's/buster/bullseye/g' /etc/apt/sources.list
echo "###### Updating repositories ... "
apt-fast update
echo "###### Running full upgrade ... "
apt-fast full-upgrade -y -o Dpkg::Options::="--force-confold"
echo "###### Please reboot now and re-run update.sh."
fi
exit exit
fi fi
echo "### Checking for version tag ..." echo "### Checking for version tag ..."