Skip to content

Commit 4fa73ff

Browse files
committed
Add some small mysql if conditions to prevent error messages.
1 parent b23c3ae commit 4fa73ff

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

install/hst-install-ubuntu.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,12 @@ killall -9 mysqld > /dev/null 2>&1
543543
mv /var/lib/mysql $hst_backups/mysql/mysql_datadir > /dev/null 2>&1
544544
cp -r /etc/mysql/* $hst_backups/mysql > /dev/null 2>&1
545545
mv -f /root/.my.cnf $hst_backups/mysql > /dev/null 2>&1
546-
if [ "$release" = '16.04' ] && [ -e '/etc/init.d/mysql' ]; then
547-
mkdir -p /var/lib/mysql > /dev/null 2>&1
548-
chown mysql:mysql /var/lib/mysql
549-
mysqld --initialize-insecure
546+
if [ "$release" = '16.04' ] [ "$release" = '18.04' ]; then
547+
if [ -e '/etc/init.d/mysql' ]; then
548+
mkdir -p /var/lib/mysql > /dev/null 2>&1
549+
chown mysql:mysql /var/lib/mysql
550+
mysqld --initialize-insecure
551+
fi
550552
fi
551553

552554
# Backup Hestia
@@ -1055,7 +1057,9 @@ if [ "$mysql" = 'yes' ]; then
10551057
mysql_install_db
10561058
fi
10571059
if [ "$release" = '16.04' ] || [ "$release" = '18.04' ]; then
1058-
mkdir /var/lib/mysql
1060+
if [ ! -d "/var/lib/mysql" ]; then
1061+
mkdir /var/lib/mysql
1062+
fi
10591063
chown mysql:mysql /var/lib/mysql
10601064
mysqld --initialize-insecure
10611065
fi

0 commit comments

Comments
 (0)