From 697b84b9b55ff6d52d3c08ae173fbc52af9558ed Mon Sep 17 00:00:00 2001 From: first Date: Mon, 7 Jul 2025 19:48:20 +0000 Subject: [PATCH] linux fixes --- synterloper/synterloper.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/synterloper/synterloper.sh b/synterloper/synterloper.sh index 767a564..c6b66cf 100644 --- a/synterloper/synterloper.sh +++ b/synterloper/synterloper.sh @@ -5,13 +5,6 @@ # This is a self-contained script for installing and uninstalling the SYNterloper # connection logging service. # -# Usage for installation: -# sudo ./synterloper.sh -# sudo ./synterloper.sh install -# -# Usage for uninstallation: -# sudo /usr/local/sbin/synterloper uninstall -# # --- Configuration --- LOG_DIR="/var/log/synterloper" @@ -54,6 +47,15 @@ install_synterloper() { # Create the system service if [ "${OS_TYPE}" = "Linux" ]; then + # Dynamically find command paths before creating the service. + echo "Detecting required command paths..." + if ! TCPDUMP_CMD_PATH=$(command -v tcpdump); then echo "Error: tcpdump not found in PATH."; exit 1; fi + if ! IP_CMD_PATH=$(command -v ip); then echo "Error: ip not found in PATH."; exit 1; fi + if ! GREP_CMD_PATH=$(command -v grep); then echo "Error: grep not found in PATH."; exit 1; fi + echo " - tcpdump found at: ${TCPDUMP_CMD_PATH}" + echo " - ip found at: ${IP_CMD_PATH}" + echo " - grep found at: ${GREP_CMD_PATH}" + echo "Creating systemd service: synterloper.service" cat > /etc/systemd/system/synterloper.service < /usr/local/etc/rc.d/synterloper <<'EOF' #!/bin/sh