From bf41d8834044b9d81ed542faa879e8c21a04fb1d Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 19 Feb 2024 09:12:33 +0100 Subject: [PATCH] Add constant to config.php + enable with installer --- config/config.php | 1 + installers/common.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config/config.php b/config/config.php index a252a556..e1d1d50d 100755 --- a/config/config.php +++ b/config/config.php @@ -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'); diff --git a/installers/common.sh b/installers/common.sh index f5ea49f3..2d05213d 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -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 }