Skip to content

Instantly share code, notes, and snippets.

View KusakabeShi's full-sized avatar
🍪

日下部 詩 KusakabeShi

🍪
View GitHub Profile
@moesoha
moesoha / generate_ptp_cost.sh
Last active March 17, 2023 18:04
Generate BIRD constants with ping statistics in 10s
#!/bin/sh
# gathering all interfaces with IPv6 link-local address
for with_ll in $(cat /proc/net/if_inet6 | grep "^fe80" | tr -s ' ' | cut -d ' ' -f 6 | sort -u); do
# POINTOPOINT flag is 1 << 4, filter non-PTP interfaces out
if [ $(expr \( $(($(cat /sys/class/net/$with_ll/flags))) / 16 \) % 2) -ne 1 ]; then
continue
fi
cost=65535
ping_rtt=N/A