linux - fix missing files when upgrading with dev/testing

This commit is contained in:
fl0ppy-d1sk 2024-05-07 16:44:48 +02:00
parent 08655350b6
commit 86ee2a9745
No known key found for this signature in database
GPG key ID: 93EE47CC3D061500
2 changed files with 2 additions and 14 deletions

View file

@ -128,13 +128,7 @@ 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.0, we need to copy the variables.env file
VERSION=$(dpkg-query -W -f='${Version}' bunkerweb)
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
# Copy env and db
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

View file

@ -130,13 +130,7 @@ 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, we need to copy the variables.env file
VERSION=$(rpm -q --queryformat '%{VERSION}' bunkerweb)
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
fi
# Copy env and db
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