From 9528927ccad9c680ca5b590882ec4d2d7210a92f Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 28 Apr 2025 01:44:22 -0700 Subject: [PATCH] Check for presence of gcc, install if needed w/ apt --- installers/common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/installers/common.sh b/installers/common.sh index ccb7e245..2b619304 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -830,6 +830,11 @@ function _configure_networking() { function _enable_network_activity_monitor() { _install_log "Enabling RaspAP network activity monitor" echo "Compiling raspap-network-monitor.c to /usr/local/bin/" + if ! command -v gcc >/dev/null 2>&1; then + echo "gcc not found, installing..." + sudo apt-get update + sudo apt-get install -y gcc || _install_status 1 "Failed to install gcc" + fi sudo gcc -O2 -o /usr/local/bin/raspap-network-monitor $webroot_dir/installers/raspap-network-monitor.c || _install_status 1 "Failed to compile raspap-network-monitor.c" echo "Copying raspap-network-activity@.service to /lib/systemd/system/" sudo cp $webroot_dir/installers/raspap-network-activity@.service /lib/systemd/system/ || _install_status 1 "Unable to move raspap-network-activity.service file"