diff --git a/synterloper/synterloper.sh b/synterloper/synterloper.sh index fa1c770..767a564 100644 --- a/synterloper/synterloper.sh +++ b/synterloper/synterloper.sh @@ -61,7 +61,10 @@ Description=SYNterloper - TCP Port Connection Logger After=network.target [Service] Type=simple -ExecStart=/bin/sh -c 'exec /usr/sbin/tcpdump -i \$(ip -4 route get 1.1.1.1 | grep -oP "dev \\K\\S+") -s ${SNAP_LEN} -w ${LOG_DIR}/capture-%Y-%m-%d_%H-%M.pcap -G ${ROTATE_SECONDS} "tcp port ${CAPTURE_PORT}"' +# ========================================================================================= +# THE FIX IS HERE: All '%' are escaped as '%%' for systemd +# ========================================================================================= +ExecStart=/bin/sh -c 'exec /usr/sbin/tcpdump -i \$(ip -4 route get 1.1.1.1 | grep -oP "dev \\K\\S+") -s ${SNAP_LEN} -w ${LOG_DIR}/capture-%%Y-%%m-%%d_%%H-%%M.pcap -G ${ROTATE_SECONDS} "tcp port ${CAPTURE_PORT}"' Restart=on-failure RestartSec=5 [Install] @@ -72,6 +75,7 @@ EOF systemctl enable synterloper.service systemctl start synterloper.service elif [ "${OS_TYPE}" = "FreeBSD" ]; then + # FreeBSD's rc.d system does not have this issue, so no change is needed here. echo "Creating rc.d script: /usr/local/etc/rc.d/synterloper" cat > /usr/local/etc/rc.d/synterloper <<'EOF' #!/bin/sh