forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreinst
More file actions
22 lines (18 loc) · 679 Bytes
/
Copy pathpreinst
File metadata and controls
22 lines (18 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
source /etc/hestiacp/hestia.conf
# shellcheck source=/usr/local/hestia/func/main.sh
source $HESTIA/func/main.sh
source_conf "$HESTIA/conf/hestia.conf"
# Run triggers only on updates
if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
exit
fi
# Configure apt to retry downloading on error
if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
fi
# Validate version number and replace if different
HESTIA_V=$(dpkg -s hestia | grep -i version | awk '{ print $2 }')
if [ ! "$HESTIA_V" = "$VERSION" ]; then
sed -i "s/VERSION=.*/VERSION='$HESTIA_V'/g" /usr/local/hestia/conf/hestia.conf
fi