Skip to content

Commit 3596187

Browse files
committed
Implement a validation function to verify the correct version number.
1 parent 9137da1 commit 3596187

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All notable changes to this project will be documented in this file.
2727
- Fixed ssh config save bug when edit the over interface.
2828
- Fixed different permission issues on user restore.
2929
- Stop trying to renew LE certs after multiple consecutive failed attempts. Thanks @dpeca
30+
- Implement a validation function to verify the correct version in hestia.conf prior to install a new one.
3031

3132
## [1.1.1] - 2020-03-24 - Hotfix
3233
### Features

src/deb/hestia/preinst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
55
exit
66
fi
77

8+
# Load hestia.conf
9+
source /usr/local/hestia/conf/hestia.conf
10+
811
# Configure apt to retry downloading on error
912
if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
1013
echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
1114
fi
1215

16+
# Validate version number and replace if different
17+
HESTIA_V=$(dpkg -s hestia | grep -i version | awk '{ print $2 }')
18+
19+
if [ ! "$HESTIA_V" = "$VERSION" ]; then
20+
sed -i "s/VERSION=.*/VERSION='$HESTIA_V'/g" /usr/local/hestia/conf/hestia.conf
21+
fi

0 commit comments

Comments
 (0)