op-packages/luci-app-pppoe-user/root/etc/hotplug.d/iface/30-interface
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

10 lines
433 B
Bash

#!/bin/sh
. /lib/functions.sh
PPPOE_TIME="$(date "+%Y-%m-%d_%H:%M:%S")"
GATEWAY="$(uci get network."$INTERFACE".gateway)"
PING="$(ping "$GATEWAY" -I "$DEVICE" -c 5 | awk '{ print strftime("%Y-%m-%d %H:%M:%S",systime())"\t" $0; fflush() }' | grep -E 'rtt|round-trip' | cut -d "=" -f2)"
echo "$PPPOE_TIME Track Device=$DEVICE, Interface=$INTERFACE, Gateway=$GATEWAY, Ping=$PING, Action=$ACTION" >> /var/pppoe-user/log/interface.log