Quellcode Simple Babelweb | +||||||||
<% echo "$data" | head -n 1 %> | ||||||||
<% echo "$data" | head -n 2 | tail -n 1 %> | ||||||||
opkg-version <% opkg list-installed | grep babeld | cut -f 3 -d ' ' %> | +||||||||
<% echo "$data" | head -n 3 | tail -n 1 %> |
interface | up | since | ipv6 | ipv4 | " + + echo "
---|---|---|---|---|
$tmpint | " + tmp=${line##* up } + newline="$newline${tmp%% *} | " + tmp="" + if [ -f "/sys/class/net/$tmpint/operstate" ]; then + tmp=$(($(date +%s) - $(stat -c %Y /sys/class/net/$tmpint/operstate))) + tmp="$((tmp/3600/24))d $((tmp/3600%24)):$((tmp/60%60)):$((tmp%60))" + fi + newline="$newline$tmp | " + tmp=${line##* ipv6 } + newline="$newline${tmp%% *} | " + tmp=${line##* ipv4 } + echo "$newline${tmp%% *} |
id | address | interface | reach | rxcost | txcost | rtt | rttcost | cost |
---|---|---|---|---|---|---|---|---|
${tmp:0:2}:${tmp:2:2}:${tmp:4:2}:${tmp:6:2}:${tmp:8:2}:${tmp:10:2} | " + tmp=${line##* address } + newline="$newline${tmp%% *} | " + tmp=${line##* if } + newline="$newline${tmp%% *} | " + tmp=${line##* reach } + newline="$newline${tmp%% *} | " + tmp=${line##* rxcost } + newline="$newline${tmp%% *} | " + tmp=${line##* txcost } + newline="$newline${tmp%% *} | " + newline="$newline$(echo "$line" | sed -n '/^.*\srtt\s\+\([0-9.]\+\).*$/s//\1/p') | " + newline="$newline$(echo "$line" | sed -n '/^.*\srttcost\s\+\([0-9]\+\).*$/s//\1/p') | " + tmp=${line##* cost } + echo "$newline${tmp%% *} |
prefix | metric |
---|---|
${tmp%%-*} | " + tmp=${line##* metric } + echo "$newline${tmp%% *} |
target | >from | installed | via | device | metric | destination id |
---|---|---|---|---|---|---|
$line | ||||||
$tmp | " + tmp=${line##* from } + tmp=${tmp##*/0} + newline="$newline${tmp%% *} | " + tmp=${line##* installed } + newline="$newline${tmp%% *} | " + tmp=${line##* via } + newline="$newline${tmp%% *} | " + tmp=${line##* if } + newline="$newline${tmp%% *} | " + tmp=${line##* metric } + newline="$newline${tmp%% *} | " + tmp=${line##* id } + tmp=${tmp%% *} + echo "$newline$tmp |
target | via | device | proto |
---|---|---|---|
$line | |||
$tmp | " + tmp=${line##* via } + newline="$newline${tmp%% *} | " + tmp=${line##* dev } + newline="$newline${tmp%% *} | " + tmp=${line##* proto } + echo "$newline${tmp%% *} |
$line | |||||
target | from | via | device | proto | metric |
---|---|---|---|---|---|
$tmp | " + tmp="$line"" from " + tmp=${tmp#* from } + newline="$newline${tmp%% *} | " + tmp=${line##* via } + newline="$newline${tmp%% *} | " + tmp=${line##* dev } + newline="$newline${tmp%% *} | " + tmp=${line##* proto } + newline="$newline${tmp%% *} | " + tmp=${line##* metric } + echo "$newline${tmp%% *} |
target | from | installed | via | device | metric | destination id |
---|---|---|---|---|---|---|
$line | ||||||
$tmp | " + tmp=${line##* from } + tmp=${tmp##*/0} + newline="$newline${tmp%% *} | " + tmp=${line##* installed } + newline="$newline${tmp%% *} | " + tmp=${line##* via } + newline="$newline${tmp%% *} | " + tmp=${line##* if } + newline="$newline${tmp%% *} | " + tmp=${line##* metric } + newline="$newline${tmp%% *} | " + tmp=${line##* id } + tmp=${tmp%% *} + echo "$newline$tmp |
+<% ping -c4 $SourcePing "$IP" 2>&1 | sed -e 's/ from \S\+//g' +%> ++
+<% traceroute -w1 -q2 $SourceTR "$IP" 2>&1 | sed -e 's/ from \S\+,/,/g' + %> ++ <% + fi fi %>