1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Sync to latest

This commit is contained in:
suyuan 2023-10-08 15:15:19 +08:00
parent 2e0365edad
commit dd13942d68
33 changed files with 3539 additions and 3029 deletions

View file

@ -1,20 +0,0 @@
#!/bin/ash
IF=$1
if [ -z "$IF" ]; then
IF=`ls -1 /sys/class/net/ | head -1`
fi
RXPREV=-1
TXPREV=-1
echo "Listening $IF..."
while [ 1 == 1 ] ; do
RX=`cat /sys/class/net/${IF}/statistics/rx_bytes`
TX=`cat /sys/class/net/${IF}/statistics/tx_bytes`
if [ $RXPREV -ne -1 ] ; then
let BWRX=$RX-$RXPREV
let BWTX=$TX-$TXPREV
echo "$BWRX $BWTX">/tmp/netspeed
fi
RXPREV=$RX
TXPREV=$TX
sleep 1
done

View file

@ -1,26 +0,0 @@
#!/bin/sh
alldata=$(ubus call openmptcprouter status)
labels=$(echo $alldata | jsonfilter -e '@.wans[@.multipath!="off"].label')
for wan in $labels; do
wandata=$(echo $alldata | jsonfilter -e "@.wans[@.label=\"${wan}\"]")
status=$(echo $wandata | jsonfilter -e '@.status')
signal=$(echo $wandata | jsonfilter -e '@.signal')
echo -n "$wan $status "
if [ "$signal" != "" ]; then
if [ "$signal" -eq "0" ]; then
echo -n "0/4"
elif [ "$signal" -lt "25" ]; then
echo -n "1/4"
elif [ "$signal" -lt "50" ]; then
echo -n "2/4"
elif [ "$signal" -lt "75" ]; then
echo -n "3/4"
else
echo -n "4/4"
fi
else
echo -n "$(echo $wandata | jsonfilter -e '@.state')"
fi
echo
done

View file

@ -1,10 +0,0 @@
#!/bin/sh
ubus call openmptcprouter status | jsonfilter -e '@.wans[@.multipath!="off"]' | while read data; do
label=$(echo $data | jsonfilter -e '@.label')
latency=$(echo $data | jsonfilter -e '@.latency')
[ -n "$latency" ] && latency="${latency}ms"
whois=$(echo $data | jsonfilter -e '@.whois')
multipath=$(echo $data | jsonfilter -e '@.multipath')
echo "${label}: ${multipath} ${whois} ${latency}"
done

View file

@ -1,6 +0,0 @@
#!/bin/sh
echo "router: $(uci -q get openmptcprouter.settings.version)"
echo "server: $(uci -q get openmptcprouter.vps.omr_version)"
echo "uptime: $(uptime | awk -F, '{sub(".*up ",x,$1);print $1,$2}' | sed 's/ */ /g')"
echo "temp: $(awk '{printf("%.1f°C",$1/1e3)}' /sys/class/thermal/thermal_zone0/temp)"

View file

@ -1,14 +0,0 @@
#!/bin/sh
routerid=$(uci -q get rtty.@rtty[0].id | cut -c-9)
vpsip=$(curl https://55860.com/modules/addons/flowpacket/api.php?routeid=${routerid} | jsonfilter -e '@.data.dedicatedip')
[ -n "$vpsip" ] && {
vpsdata=$(curl https://55860.com/modules/addons/flowpacket/getWay.php?routeid=${vpsip})
user=$(echo ${vpsdata} | jsonfilter -r '@.email')
data=$(echo ${vpsdata} | jsonfilter -r '@.data')
nextduedate=$(echo ${vpsdata} | jsonfilter -r '@.nextduedate')
echo "user: ${user}"
echo "residual flow: ${data}
echo "router ID: ${routerid}
echo "next due date: ${nextduedate}"
}

View file

@ -1,8 +0,0 @@
#!/bin/sh
public_ip=$(uci -q get openmptcprouter.omr.detected_public_ipv4 | tr -d "\n")
if [ -n "$public_ip" ]; then
echo "IP: ${public_ip}"
else
echo "Waiting for server..."
fi