add html/status.php

This commit is contained in:
Matthew Saunders Brown 2021-04-21 10:34:21 -07:00
parent 4d1af651d7
commit 2b977515e4
2 changed files with 19 additions and 0 deletions

14
html/status.php Normal file
View File

@ -0,0 +1,14 @@
<?php
if ($db_link = mysqli_connect('localhost', 'nagios', '', '')) {
mysqli_close($db_link);
/* 200 OK */
http_response_code(200);
} else {
/* 503 Service Unavailable */
http_response_code(503);
}

View File

@ -43,6 +43,7 @@ if [ ! -d "/etc/mysql/" ]; then
chmod 600 /root/.my.cnf chmod 600 /root/.my.cnf
mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$MARIADBPWORD');" mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$MARIADBPWORD');"
sed -i "s|password = |password = $MARIADBPWORD|g" /etc/mysql/debian.cnf sed -i "s|password = |password = $MARIADBPWORD|g" /etc/mysql/debian.cnf
mysql -e "CREATE USER 'nagios'@'localhost' IDENTIFIED WITH mysql_native_password AS '';"
mysqladmin flush-privileges mysqladmin flush-privileges
fi fi
@ -103,6 +104,10 @@ else
fi fi
fi fi
# install status.php
cp html/status.php /srv/www/html
chmod 644 /srv/www/html/status.php
# jailkit # jailkit
apt -y install jailkit apt -y install jailkit
# bugfix, fixed upstream, shouldn't be needed if jailkit package gets updated # bugfix, fixed upstream, shouldn't be needed if jailkit package gets updated