install api 2.0 apache config on update

This commit is contained in:
Kyle Robbertze 2021-05-19 19:22:15 +02:00
parent 2df0189a90
commit 2024f9a887
1 changed files with 29 additions and 22 deletions

View File

@ -809,7 +809,7 @@ will be moved to /etc/airtime/airtime.conf.tmp"
if [ "$apache" = "t" ]; then
# If the user selects an "in-place" install or passes in a web root,
# we need to replace the old apache airtime.conf
rm /etc/apache2/sites-available/airtime.conf /etc/apache2/sites-enabled/airtime.conf
rm -f /etc/apache2/sites-available/airtime.conf /etc/apache2/sites-enabled/airtime.conf
fi
if [ -d /usr/share/airtime -a web_root = /usr/share/airtime ]; then
@ -821,6 +821,13 @@ will be moved to /etc/airtime/airtime.conf.tmp"
fi
fi
API2_APACHE_CONF=$(grep -F "ProxyPass" /etc/apache2/sites-available/airtime.conf || true)
if [ -z "${API2_APACHE_CONF}" -a "$apache" = "t" ]; then
# Remove Apache configuration so that the ProxyPass configuration for API 2.0
# is installed
rm -f /etc/apache2/sites-available/airtime.conf /etc/apache2/sites-enabled/airtime.conf
fi
if [ "$apache" = "f" -a ${_i} -eq 1 ]; then
echo -e "Install default Airtime apache configuration? (Y/n): \c"
read IN