Create _enable_network_activity_monitor() + _symlink_net_activity()

This commit is contained in:
billz
2025-04-27 01:34:22 -07:00
parent 2d7d521501
commit d7428e40e3

View File

@@ -75,6 +75,7 @@ function _update_raspap() {
_download_latest_files
_change_file_ownership
_patch_system_files
_symlink_net_activity
_create_plugin_scripts
_install_complete
}
@@ -818,9 +819,32 @@ function _configure_networking() {
echo -e
_enable_raspap_daemon
fi
# Enable RaspAP network activity monitor
_enable_network_activity_monitor
_install_status 0
}
# Install and enable RaspAP network activity monitor
function _enable_network_activity_monitor() {
_install_log "Enabling RaspAP network activity monitor"
sudo cp $webroot_dir/installers/network-activity.sh "$raspap_dir/hostapd" || _install_status 1 "Unable to copy network-activity.sh"
sudo cp $webroot_dir/installers/raspap-network-activity@.service /lib/systemd/system/ || _install_status 1 "Unable to move raspap-network-activity.service file"
sudo systemctl daemon-reload
sudo systemctl enable raspap-network-activity@wlan0.service || _install_status 1 "Failed to enable raspap-network-activity.service"
sudo systemctl start raspap-network-activity@wlan0.service || _install_status 1 "Failed to start raspap-network-activity.service"
sleep 0.5
_symlink_net_activity
echo "Network activity monitor enabled"
}
function _symlink_net_activity() {
echo "Symlinking /dev/shm/net_activity to $webroot_dir/app/net_activity"
sudo ln -sf /dev/shm/net_activity $webroot_dir/app/net_activity || _install_status 1 "Failed to link net_activity to ${webroot_dir}/app"
sudo chown -R $raspap_user:$raspap_user $webroot_dir/app/net_activity || _install_status 1 "Unable to set ownership of ${webroot_dir}/app/net_activity"
}
# Prompt to configure TCP BBR option
function _prompt_configure_tcp_bbr() {
_install_log "Configure TCP BBR congestion control"