forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreinst
More file actions
25 lines (19 loc) · 685 Bytes
/
Copy pathpreinst
File metadata and controls
25 lines (19 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Run triggers only on updates
if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
exit
fi
# Load hestia.conf
source /usr/local/hestia/conf/hestia.conf
# 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
if [ -e "/etc/hestiacp/hooks/pre_install.sh" ]; then
/etc/hestiacp/hooks/pre_install.sh
fi