Add constant to config.php + enable with installer

This commit is contained in:
billz 2024-02-19 09:12:33 +01:00
parent 1f1fa3711a
commit bf41d88340
2 changed files with 3 additions and 0 deletions

View file

@ -59,6 +59,7 @@ define('RASPI_CHANGETHEME_ENABLED', true);
define('RASPI_VNSTAT_ENABLED', true);
define('RASPI_SYSTEM_ENABLED', true);
define('RASPI_MONITOR_ENABLED', false);
define('RASPI_RESTAPI_ENABLED', false);
// Locale settings
define('LOCALE_ROOT', 'locale');

View file

@ -602,6 +602,8 @@ function _install_restapi() {
sudo mv $webroot_dir/installers/restapi.service /lib/systemd/system/ || _install_status 1 "Unable to move restapi.service file"
sudo systemctl daemon-reload
sudo systemctl enable restapi.service || _install_status 1 "Failed to enable restapi.service"
echo "Enabling RestAPI management option"
sudo sed -i "s/\('RASPI_RESTAPI_ENABLED', \)false/\1true/g" "$webroot_dir/includes/config.php" || _install_status 1 "Unable to modify config.php"
_install_status 0
}