Skip to content

Commit a8c7be0

Browse files
author
Kristan Kenney
committed
Simplify installation of dependencies
Thanks @vestacp-user
1 parent b871deb commit a8c7be0

File tree

2 files changed

+12
-68
lines changed

2 files changed

+12
-68
lines changed

install/hst-install-debian.sh

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ elif [ "$release" -eq 10 ]; then
6464
ipset libapache2-mpm-itk"
6565
fi
6666

67+
installer_dependencies="apt-transport-https curl dirmngr gnupg wget"
68+
6769
# Defining help function
6870
help() {
6971
echo "Usage: $0 [OPTIONS]
@@ -310,40 +312,10 @@ apt-get -qq update
310312
# Creating backup directory
311313
mkdir -p $hst_backups
312314

313-
# Checking wget
314-
if [ ! -e '/usr/bin/wget' ]; then
315-
echo "[ * ] Installing wget..."
316-
apt-get -y install wget >> $LOG
317-
check_result $? "Can't install wget"
318-
fi
319-
320-
# Checking curl
321-
if [ ! -e '/usr/bin/curl' ]; then
322-
echo "[ * ] Installing curl..."
323-
apt-get -y install curl >> $LOG
324-
check_result $? "Can't install curl"
325-
fi
326-
327-
# Checking dirmngr
328-
if [ ! -e '/usr/bin/dirmngr' ]; then
329-
echo "[ * ] Installing dirmngr..."
330-
apt-get -y install dirmngr >> $LOG
331-
check_result $? "Can't install dirmngr"
332-
fi
333-
334-
# Check if apt-transport-https is installed
335-
if [ ! -e '/usr/lib/apt/methods/https' ]; then
336-
echo "[ * ] Installing apt-transport-https..."
337-
apt-get -y install apt-transport-https >> $LOG
338-
check_result $? "Can't install apt-transport-https"
339-
fi
340-
341-
# Check if gnupg or gnupg2 is installed
342-
if [ ! -e '/usr/lib/gnupg2' ] || [ ! -e '/usr/lib/gnupg' ]; then
343-
echo "[ * ] Installing gnupg2..."
344-
apt-get -y install gnupg2 >> $LOG
345-
check_result $? "Can't install gnupg2"
346-
fi
315+
# Pre-install packages
316+
echo "[ * ] Installing dependencies..."
317+
apt-get -y install $installer_dependencies >> $LOG
318+
check_result $? "Package installation failed, check log file for more details."
347319

348320
# Check if apparmor is installed
349321
if [ $(dpkg-query -W -f='${Status}' apparmor 2>/dev/null | grep -c "ok installed") -eq 0 ]; then

install/hst-install-ubuntu.sh

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
4646
hestia-nginx hestia-php vim-common vsftpd whois zip acl sysstat setpriv
4747
ipset libonig5 libzip5"
4848

49+
installer_dependencies="apt-transport-https curl dirmngr gnupg wget"
50+
4951
# Defining help function
5052
help() {
5153
echo "Usage: $0 [OPTIONS]
@@ -292,40 +294,10 @@ apt-get -qq update
292294
# Creating backup directory
293295
mkdir -p $hst_backups
294296

295-
# Checking wget
296-
if [ ! -e '/usr/bin/wget' ]; then
297-
echo "[ * ] Installing wget..."
298-
apt-get -y install wget >> $LOG
299-
check_result $? "Can't install wget"
300-
fi
301-
302-
# Checking curl
303-
if [ ! -e '/usr/bin/curl' ]; then
304-
echo "[ * ] Installing curl..."
305-
apt-get -y install curl >> $LOG
306-
check_result $? "Can't install curl"
307-
fi
308-
309-
# Check if apt-transport-https is installed
310-
if [ ! -e '/usr/lib/apt/methods/https' ]; then
311-
echo "[ * ] Installing apt-transport-https..."
312-
apt-get -y install apt-transport-https >> $LOG
313-
check_result $? "Can't install apt-transport-https"
314-
fi
315-
316-
# Check if apt-add-repository is installed
317-
if [ ! -e '/usr/bin/apt-add-repository' ]; then
318-
echo "[ * ] Installing apt-add-repository..."
319-
apt-get -y install software-properties-common >> $LOG
320-
check_result $? "Can't install software-properties-common"
321-
fi
322-
323-
# Check if gnupg or gnupg2 is installed
324-
if [ ! -e '/usr/lib/gnupg2' ] || [ ! -e '/usr/lib/gnupg' ]; then
325-
echo "[ * ] Installing gnupg2..."
326-
apt-get -y install gnupg2 >> $LOG
327-
check_result $? "Can't install gnupg2"
328-
fi
297+
# Pre-install packages
298+
echo "[ * ] Installing dependencies..."
299+
apt-get -y install $installer_dependencies >> $LOG
300+
check_result $? "Package installation failed, check log file for more details."
329301

330302
# Check repository availability
331303
wget --quiet "https://$GPG/deb_signing.key" -O /dev/null

0 commit comments

Comments
 (0)