mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix shenanigans when removing DEB and RPM packages with 1.5.X versions
This commit is contained in:
parent
f2154fb6af
commit
8e771ec379
4 changed files with 10 additions and 5 deletions
|
|
@ -35,7 +35,7 @@ for test in tests/core/* ; do
|
|||
done
|
||||
shopt -u globstar
|
||||
# linux
|
||||
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/linux/scripts/*.sh
|
||||
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/linux/scripts/beforeInstall.sh
|
||||
# db
|
||||
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/common/db/Database.py
|
||||
sed -i "s@${OLD_VERSION}@${NEW_VERSION}@g" src/common/db/model.py
|
||||
|
|
|
|||
|
|
@ -128,14 +128,15 @@ elif [ "$1" = "purge" ]; then
|
|||
purge
|
||||
else
|
||||
echo "Package is being upgraded"
|
||||
# Check the version of the package and if it's inferior to 1.5.6, we need to copy the variables.env file
|
||||
# Check the version of the package and if it's inferior to 1.5.0, we need to copy the variables.env file
|
||||
VERSION=$(dpkg-query -W -f='${Version}' bunkerweb)
|
||||
if [ "$VERSION" != "1.5.6" ]; then
|
||||
if ! [[ "$VERSION" =~ ^1\.5 ]]; then
|
||||
echo "ℹ️ Copyenv variables to /var/tmp/bunkerweb/*.env"
|
||||
do_and_check_cmd cp -f /opt/bunkerweb/variables.env /var/tmp/variables.env
|
||||
do_and_check_cmd cp -f /opt/bunkerweb/ui.env /var/tmp/ui.env
|
||||
fi
|
||||
cp -f /etc/bunkerweb/variables.env /var/tmp/variables.env
|
||||
cp -f /etc/bunkerweb/ui.env /var/tmp/ui.env
|
||||
cp -f /var/lib/bunkerweb/db.sqlite3 /var/tmp/db.sqlite3
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ if [ "$1" = "0" ]; then
|
|||
purge
|
||||
elif [ "$1" = "1" ]; then
|
||||
echo "Package is being upgraded"
|
||||
# Check the version of the package and if it's inferior to 1.5.6, we need to copy the variables.env file
|
||||
# Check the version of the package and if it's inferior to 1.5, we need to copy the variables.env file
|
||||
VERSION=$(rpm -q --queryformat '%{VERSION}' bunkerweb)
|
||||
if [ "$VERSION" != "1.5.6" ]; then
|
||||
if ! [[ "$VERSION" =~ ^1\.5 ]]; then
|
||||
echo "ℹ️ Copy /etc/bunkerweb/variables.env to /var/tmp/bunkerweb/variables.env"
|
||||
do_and_check_cmd cp -f /opt/bunkerweb/variables.env /var/tmp/variables.env
|
||||
do_and_check_cmd cp -f /opt/bunkerweb/ui.env /var/tmp/ui.env
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ if [ -f /etc/os-release ]; then
|
|||
do_and_check_cmd cp -f /var/tmp/ui.env /etc/bunkerweb/ui.env
|
||||
fi
|
||||
fi
|
||||
if [ -f /var/tmp/db.sqlite3 ]; then
|
||||
echo "ℹ️ Copy /var/tmp/db.sqlite3 to /var/lib/bunkerweb/db.sqlite3"
|
||||
do_and_check_cmd cp -f /var/tmp/db.sqlite3 /var/lib/bunkerweb/db.sqlite3
|
||||
fi
|
||||
else
|
||||
echo "❌ Error: /etc/os-release not found"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue