Files

23 lines
336 B
Bash
Raw Permalink Normal View History

2026-01-23 09:59:19 +01:00
#!/bin/bash
2026-01-23 08:55:18 +01:00
#run from crontab
2026-01-23 09:59:19 +01:00
2026-01-23 08:55:18 +01:00
. /home/.bashrc
2026-01-23 09:59:19 +01:00
[ -f "$LOG_CONN" ] || exit 0
2026-01-23 08:55:18 +01:00
. refresh_time
2026-01-23 09:59:19 +01:00
STATUS=network.conns
2026-01-23 08:55:18 +01:00
if [ -f $NET_STATUS ] ; then
STATUS=$(cat $NET_STATUS)
fi
2026-01-23 09:59:19 +01:00
DIR="$LOG_CONN_DIR/$STATUS"
2026-01-23 08:55:18 +01:00
mkdir -p $DIR
2026-01-23 09:59:19 +01:00
grepip "$LOG_CONN" > "$DIR/${DATE}_${TIME}.conn"
mv -f "$LOG_CONN" "$LOG_CONN_DIR/prev.log"
2026-01-23 08:55:18 +01:00
2026-01-23 09:59:19 +01:00
systemctl restart tcpd
2026-01-23 08:55:18 +01:00