#!/bin/sh

# 定义抓包函数
capture_packets() {
    interface=${1}
    output_file=${2}
    timestamp=$(date +"%Y%m%d%H%M%S")  # 获取当前日期和时间
    output_file_with_timestamp="${output_file}_${timestamp}.pcap"
    tcpdump -i $interface -w $output_file_with_timestamp &
}

interfaces="br-lan eth2"
output_files="local redcap"

capture_packets "br-lan" "local"
capture_packets "eth2" "redcap"


sleep 5
ipsec up myvpn
sleep 600
