1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2025-07-15 17:17:39 +02:00

Check for presence of gcc, install if needed w/ apt

This commit is contained in:
billz 2025-04-28 01:44:22 -07:00
parent 384e1df1b7
commit 9528927cca

View File

@ -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"