🏅 Sync 2022-09-05 03:00:40
81
3ginfo/Makefile
Normal file
@ -0,0 +1,81 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=3ginfo
|
||||
PKG_VERSION:=20190418
|
||||
PKG_RELEASE:=3
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/3ginfo/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Information about status of 3G/4G modem
|
||||
MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/3ginfo
|
||||
$(call Package/3ginfo/Default)
|
||||
DEPENDS:=+3ginfo-text +uhttpd
|
||||
endef
|
||||
|
||||
define Package/3ginfo-lite
|
||||
$(call Package/3ginfo/Default)
|
||||
TITLE+= (lite version)
|
||||
DEPENDS:=+comgt
|
||||
endef
|
||||
|
||||
define Package/3ginfo-qmisignal
|
||||
$(call Package/3ginfo/Default)
|
||||
TITLE+= (qmi signal)
|
||||
DEPENDS:=+uqmi +uhttpd
|
||||
endef
|
||||
|
||||
define Package/3ginfo-text
|
||||
$(call Package/3ginfo/Default)
|
||||
TITLE+= (text version)
|
||||
DEPENDS:=+comgt
|
||||
endef
|
||||
|
||||
define Package/3ginfo-text/conffiles
|
||||
/etc/config/3ginfo
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/3ginfo/install
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
define Package/3ginfo-lite/install
|
||||
$(CP) ./files-lite/* $(1)
|
||||
$(CP) ./files-text/usr/share/3ginfo/mccmnc.dat $(1)/usr/share/3ginfo-lite
|
||||
$(CP) ./files-text/usr/share/3ginfo/scripts/probeport.gcom $(1)/usr/share/3ginfo-lite
|
||||
endef
|
||||
|
||||
define Package/3ginfo-qmisignal/install
|
||||
$(CP) ./files-qmisignal/* $(1)
|
||||
|
||||
$(FIND) $(1) -type f -name '*.js' | while read src; do \
|
||||
uglifyjs "$$$$src" -o "$$$$src".1 && \
|
||||
mv "$$$$src".1 "$$$$src" || true; \
|
||||
done
|
||||
endef
|
||||
|
||||
define Package/3ginfo-text/install
|
||||
$(CP) ./files-text/* $(1)
|
||||
endef
|
||||
|
||||
define Package/3ginfo-text/postinst
|
||||
#!/bin/sh
|
||||
[ -n "$${IPKG_INSTROOT}" ] || {
|
||||
ln -sf /usr/share/3ginfo/cgi-bin/3ginfo.sh /usr/bin/3ginfo
|
||||
}
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,3ginfo))
|
||||
$(eval $(call BuildPackage,3ginfo-lite))
|
||||
$(eval $(call BuildPackage,3ginfo-qmisignal))
|
||||
$(eval $(call BuildPackage,3ginfo-text))
|
47
3ginfo/files-lite/usr/share/3ginfo-lite/3ginfo.gcom
Normal file
@ -0,0 +1,47 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.01
|
||||
waitquiet 0.01 0.01
|
||||
|
||||
let $c="AT+CSQ^m"
|
||||
let $r="+CSQ"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+COPS=3,0;+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+COPS=3,2;+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CREG=2;+CREG?^m"
|
||||
let $r="+CREG"
|
||||
gosub readatcmd
|
||||
|
||||
exit 0
|
||||
|
||||
:readatcmd
|
||||
let i=15
|
||||
send $c
|
||||
:loop
|
||||
get 0.1 "^m" $s
|
||||
let l=len($r)
|
||||
if len($s) < l goto loop1
|
||||
if $mid($s,1,l) <> $r goto loop1
|
||||
print $s
|
||||
return
|
||||
|
||||
:loop1
|
||||
if len($s) < 2 goto loop2
|
||||
if $mid($s,1,2) = "ER" return
|
||||
if $mid($s,1,2) = "CO" return
|
||||
if len($s) < 10 goto loop2
|
||||
if $mid($s,1,10) != "+CME ERROR" goto loop2
|
||||
print $s
|
||||
return
|
||||
:loop2
|
||||
if i = 0 exit 0
|
||||
let i=i-1
|
||||
goto loop
|
118
3ginfo/files-lite/usr/share/3ginfo-lite/3ginfo.sh
Normal file
@ -0,0 +1,118 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2010-2019 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
|
||||
RES="/usr/share/3ginfo-lite"
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
touch /tmp/modem
|
||||
DEVICE=$(cat /tmp/modem)
|
||||
else
|
||||
echo "$DEVICE" > /tmp/modem
|
||||
fi
|
||||
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
devices=$(ls /dev/ttyUSB* /dev/cdc-wdm* /dev/ttyACM* /dev/ttyHS* 2>/dev/null | sort -r)
|
||||
for d in $devices; do
|
||||
DEVICE=$d gcom -s $RES/probeport.gcom > /dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
echo "$d" > /tmp/modem
|
||||
break
|
||||
fi
|
||||
done
|
||||
DEVICE=$(cat /tmp/modem)
|
||||
fi
|
||||
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
echo '{"error":"Device not found"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
O=$(gcom -d $DEVICE -s $RES/3ginfo.gcom 2>/dev/null)
|
||||
|
||||
# CSQ
|
||||
CSQ=$(echo "$O" | awk -F[,\ ] '/^\+CSQ/ {print $2}')
|
||||
|
||||
[ "x$CSQ" = "x" ] && CSQ=-1
|
||||
if [ $CSQ -ge 0 -a $CSQ -le 31 ]; then
|
||||
CSQ_PER=$(($CSQ * 100/31))
|
||||
else
|
||||
CSQ="-"
|
||||
CSQ_PER="0"
|
||||
fi
|
||||
|
||||
# COPS numeric
|
||||
COPS_NUM=$(echo "$O" | awk -F[\"] '/^\+COPS: .,2/ {print $2}' | head -1)
|
||||
if [ "x$COPS_NUM" = "x" ]; then
|
||||
COPS_NUM="-"
|
||||
COPS_MCC="-"
|
||||
COPS_MNC="-"
|
||||
else
|
||||
COPS_MCC=${COPS_NUM:0:3}
|
||||
COPS_MNC=${COPS_NUM:3:3}
|
||||
COPS=$(awk -F[\;] '/'$COPS_NUM'/ {print $2}' $RES/mccmnc.dat)
|
||||
fi
|
||||
[ "x$COPS" = "x" ] && COPS=$COPS_NUM
|
||||
|
||||
if [ -z "$FORCE_PLMN" ]; then
|
||||
# COPS alphanumeric
|
||||
T=$(echo "$O" | awk -F[\"] '/^\+COPS: .,0/ {print $2}')
|
||||
[ "x$T" != "x" ] && COPS="$T"
|
||||
fi
|
||||
|
||||
# CREG
|
||||
eval $(echo "$O" | awk -F[,] '/^\+CREG/ {gsub(/[[:space:]"]+/,"");printf "T=\"%d\";LAC_HEX=\"%X\";CID_HEX=\"%X\";LAC_DEC=\"%d\";CID_DEC=\"%d\";MODE1=\"%d\"", $2, "0x"$3, "0x"$4, "0x"$3, "0x"$4, $5}')
|
||||
case "$T" in
|
||||
0*) REG="0";;
|
||||
1*) REG="1";;
|
||||
2*) REG="2";;
|
||||
3*) REG="3";;
|
||||
5*) REG="5";;
|
||||
*) REG="-";;
|
||||
esac
|
||||
|
||||
# MODE
|
||||
[ -z "$MODE1" -o "x$MODE1" = "x0" ] && MODE1=$(echo "$O" | awk -F[,] '/^\+COPS/ {print $4;exit}')
|
||||
case "$MODE1" in
|
||||
2*) MODE="UMTS";;
|
||||
3*) MODE="EDGE";;
|
||||
4*) MODE="HSDPA";;
|
||||
5*) MODE="HSUPA";;
|
||||
6*) MODE="HSPA";;
|
||||
7*) MODE="LTE";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
|
||||
T=$(echo "$O" | awk -F[,\ ] '/^\+CME ERROR:/ {print $0;exit}')
|
||||
if [ -n "$T" ]; then
|
||||
case "$T" in
|
||||
"+CME ERROR: 10"*) REG="SIM not inserted";;
|
||||
"+CME ERROR: 11"*) REG="SIM PIN required";;
|
||||
"+CME ERROR: 12"*) REG="SIM PUK required";;
|
||||
"+CME ERROR: 13"*) REG="SIM failure";;
|
||||
"+CME ERROR: 14"*) REG="SIM busy";;
|
||||
"+CME ERROR: 15"*) REG="SIM wrong";;
|
||||
"+CME ERROR: 17"*) REG="SIM PIN2 required";;
|
||||
"+CME ERROR: 18"*) REG="SIM PUK2 required";;
|
||||
*) REG=$(echo "$T" | cut -f2 -d: | xargs);;
|
||||
esac
|
||||
fi
|
||||
cat <<EOF
|
||||
{
|
||||
"csq":"$CSQ",
|
||||
"signal":"$CSQ_PER",
|
||||
"operator_name":"$COPS",
|
||||
"operator_mcc":"$COPS_MCC",
|
||||
"operator_mnc":"$COPS_MNC",
|
||||
"mode":"$MODE",
|
||||
"registration":"$REG",
|
||||
"lac_dec":"$LAC_DEC",
|
||||
"lac_hex":"$LAC_HEX",
|
||||
"cid_dec":"$CID_DEC",
|
||||
"cid_hex":"$CID_HEX"
|
||||
}
|
||||
EOF
|
||||
exit 0
|
9
3ginfo/files-qmisignal/www/cgi-bin/qmisignal.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
echo "Content-type: application/json"
|
||||
echo ""
|
||||
if [ -e /dev/cdc-wdm0 ]; then
|
||||
uqmi -s -d /dev/cdc-wdm0 --get-signal-info | sed 's/"type":"hdr".*,"type"/"type"/g'
|
||||
else
|
||||
echo "{}"
|
||||
fi
|
||||
exit 0
|
42
3ginfo/files-qmisignal/www/qmisignal.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Status" />
|
||||
<meta name="author" content="Cezary Jackiewicz">
|
||||
<title>QMI</title>
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<p> </p>
|
||||
<table class='table table-condensed table-striped'>
|
||||
<colgroup><col class='col-xs-4'><col class='col-xs-2'><col class='col-xs-2'><col class='col-xs-2'><col class='col-xs-2'></colgroup>
|
||||
|
||||
<thead><tr><th>Parametr</th><th>Wartość</th><th>Min</th><th>Max</th><th>Jednostka</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><span id='key1'> </span></td><td><span id='val1'></span></td><td><span id='min1'></span></td><td><span id='max1'></span></td><td><span id='unit1'></span></td></tr>
|
||||
<tr><td><span id='key2'> </span></td><td><span id='val2'></span></td><td><span id='min2'></span></td><td><span id='max2'></span></td><td><span id='unit2'></span></td></tr>
|
||||
<tr><td><span id='key3'> </span></td><td><span id='val3'></span></td><td><span id='min3'></span></td><td><span id='max3'></span></td><td><span id='unit3'></span></td></tr>
|
||||
<tr><td><span id='key4'> </span></td><td><span id='val4'></span></td><td><span id='min4'></span></td><td><span id='max4'></span></td><td><span id='unit4'></span></td></tr>
|
||||
<tr><td><span id='key5'> </span></td><td><span id='val5'></span></td><td><span id='min5'></span></td><td><span id='max5'></span></td><td><span id='unit5'></span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="div_g" style="width:100%; height:300px;"><p class="text-center">Trwa zbieranie danych...</p></div>
|
||||
<p><i>Interwał 3s, okno 15 minut.</i></p>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dygraph/1.1.1/dygraph-combined.js"></script>
|
||||
<script src="/qmisignal.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
102
3ginfo/files-qmisignal/www/qmisignal.js
Normal file
@ -0,0 +1,102 @@
|
||||
var data = [];
|
||||
var g;
|
||||
var min = [], max = [];
|
||||
|
||||
var colors = [];
|
||||
colors['signal'] = '#333';
|
||||
colors['rssi'] = '#333';
|
||||
colors['rsrp'] = '#333';
|
||||
colors['ecio'] = '#333';
|
||||
colors['rsrq'] = '#333';
|
||||
colors['snr'] = '#333';
|
||||
|
||||
window.intervalId = setInterval(function() {
|
||||
$.getJSON( "/cgi-bin/qmisignal.sh", function(data1) {
|
||||
|
||||
var idx=0
|
||||
$.each(data1, function(i, val) {
|
||||
idx++;
|
||||
|
||||
unit='';
|
||||
if (!min[i]) {min[i]=999;max[i]=-999;}
|
||||
|
||||
switch(i) {
|
||||
case "type":
|
||||
val=(val).toUpperCase();
|
||||
break;
|
||||
case "signal":
|
||||
case "rssi":
|
||||
case "rsrp":
|
||||
if (val < min[i]) {min[i] = val;}
|
||||
if (val > max[i]) {max[i] = val;}
|
||||
unit='dBm'
|
||||
break;
|
||||
case "ecio":
|
||||
case "rsrq":
|
||||
case "snr":
|
||||
if (val < min[i]) {min[i] = val;}
|
||||
if (val > max[i]) {max[i] = val;}
|
||||
unit='dB'
|
||||
break;
|
||||
}
|
||||
|
||||
$("#key"+idx).text(''+i);
|
||||
$("#val"+idx).text(''+val);
|
||||
$('#val'+idx).css('color', colors[i]);
|
||||
$("#unit"+idx).text(''+unit);
|
||||
$('#unit'+idx).css('color', colors[i]);
|
||||
if (i != 'type')
|
||||
{
|
||||
$("#min"+idx).text(''+min[i]);
|
||||
$('#min'+idx).css('color', colors[i]);
|
||||
$("#max"+idx).text(''+max[i]);
|
||||
$('#max'+idx).css('color', colors[i]);
|
||||
}
|
||||
});
|
||||
|
||||
data.push([new Date(),
|
||||
data1["signal"],
|
||||
data1["rssi"],
|
||||
data1["rsrp"],
|
||||
data1["ecio"],
|
||||
data1["rsrq"],
|
||||
data1["snr"]
|
||||
]);
|
||||
|
||||
if (data.length > 300) {data.shift();}
|
||||
if (g==null) {
|
||||
g = new Dygraph(document.getElementById("div_g"), data, {
|
||||
drawPoints: false,
|
||||
showRoller: false,
|
||||
labels: ['', 'Signal', 'RSSI', 'RSRP', 'ECIO', 'RSRQ', 'SNR'],
|
||||
labelsSeparateLines: true,
|
||||
ylabel: 'RSSI, RSRP [dBm]',
|
||||
y2label: 'ECIO, RSRQ, SNR [dB]',
|
||||
series : {
|
||||
'ECIO': {axis: 'y2'},
|
||||
'RSRQ': {axis: 'y2'},
|
||||
'SNR': {axis: 'y2'}
|
||||
},
|
||||
axes: {
|
||||
y: {independentTicks: true},
|
||||
y2: {
|
||||
independentTicks: true,
|
||||
ticker: Dygraph.numericLinearTicks,
|
||||
drawGrid: true,
|
||||
gridLineColor: "#ff0000",
|
||||
gridLinePattern: [4,4]
|
||||
}
|
||||
}
|
||||
});
|
||||
var tcolors = g.getColors();
|
||||
colors['signal'] = tcolors[0];
|
||||
colors['rssi'] = tcolors[1];
|
||||
colors['rsrp'] = tcolors[2];
|
||||
colors['ecio'] = tcolors[3];
|
||||
colors['rsrq'] = tcolors[4];
|
||||
colors['snr'] = tcolors[5];
|
||||
} else {
|
||||
g.updateOptions({'file':data});
|
||||
}
|
||||
});
|
||||
}, 3000);
|
6
3ginfo/files-text/etc/config/3ginfo
Normal file
@ -0,0 +1,6 @@
|
||||
config '3ginfo'
|
||||
option 'device' ''
|
||||
option 'pincode' ''
|
||||
option 'http_port' '81'
|
||||
option 'language' 'pl'
|
||||
option 'network' 'wan'
|
4
3ginfo/files-text/etc/hotplug.d/usb/99-3ginfo
Normal file
@ -0,0 +1,4 @@
|
||||
case "$ACTION" in
|
||||
remove)
|
||||
[ -f /tmp/pincode_was_given ] && rm -f /tmp/pincode_was_given;;
|
||||
esac
|
4
3ginfo/files-text/etc/uci-defaults/99-3ginfo
Normal file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
ln -s /usr/share/3ginfo/cgi-bin/3ginfo.sh /usr/bin/3ginfo
|
||||
exit 0
|
598
3ginfo/files-text/usr/share/3ginfo/cgi-bin/3ginfo.sh
Normal file
@ -0,0 +1,598 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2010-2019 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
|
||||
# Output format
|
||||
# 0 - html
|
||||
# 1 - txt
|
||||
# 2 - json
|
||||
|
||||
FORMAT=1
|
||||
RES="/usr/share/3ginfo"
|
||||
|
||||
LANG=$(uci -q get 3ginfo.@3ginfo[0].language)
|
||||
[ "x$LANG" = "x" ] && LANG="en"
|
||||
|
||||
getpath() {
|
||||
devname="$(basename "$1")"
|
||||
case "$devname" in
|
||||
'tty'*)
|
||||
devpath="$(readlink -f /sys/class/tty/$devname/device)"
|
||||
P=${devpath%/*/*}
|
||||
;;
|
||||
*)
|
||||
devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
|
||||
P=${devpath%/*}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
showjsonerror() {
|
||||
echo "{\"error\": \"$1\"}"
|
||||
}
|
||||
|
||||
if [ "x$1" = "xjson" ]; then
|
||||
FORMAT=2
|
||||
else
|
||||
if [ "`basename $0`" = "3ginfo" ]; then
|
||||
FORMAT=1
|
||||
else
|
||||
FORMAT=0
|
||||
echo -e "Content-type: text/html\n\n"
|
||||
fi
|
||||
|
||||
if [ ! -e $RES/msg.dat.$LANG ]; then
|
||||
echo "File missing: $RES/msg.dat.$LANG"
|
||||
exit 0
|
||||
fi
|
||||
. $RES/msg.dat.$LANG
|
||||
fi
|
||||
|
||||
# odpytanie urzadzenia
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
|
||||
if echo "x$DEVICE" | grep -q "192.168."; then
|
||||
if grep -q "Vendor=1bbb" /sys/kernel/debug/usb/devices; then
|
||||
O=$($RES/scripts/alcatel_hilink.sh $DEVICE)
|
||||
fi
|
||||
if grep -q "Vendor=12d1" /sys/kernel/debug/usb/devices; then
|
||||
O=$($RES/scripts/huawei_hilink.sh $DEVICE)
|
||||
fi
|
||||
if grep -q "Vendor=19d2" /sys/kernel/debug/usb/devices; then
|
||||
O=$($RES/scripts/zte.sh $DEVICE)
|
||||
fi
|
||||
SEC=$(uci -q get 3ginfo.@3ginfo[0].network)
|
||||
SEC=${SEC:-wan}
|
||||
else
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
devices=$(ls /dev/ttyUSB* /dev/cdc-wdm* /dev/ttyACM* /dev/ttyHS* 2>/dev/null | sort -r);
|
||||
for d in $devices; do
|
||||
DEVICE=$d gcom -s $RES/scripts/probeport.gcom > /dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
uci set 3ginfo.@3ginfo[0].device="$d"
|
||||
uci commit 3ginfo
|
||||
break
|
||||
fi
|
||||
done
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
fi
|
||||
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
[ $FORMAT -eq 0 ] && echo "<h3 style='color:red;' class=\"c\">$NOTDETECTED</h3>"
|
||||
[ $FORMAT -eq 1 ] && echo $NOTDETECTED
|
||||
[ $FORMAT -eq 2 ] && showjsonerror "NOTDETECTED"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -e $DEVICE ]; then
|
||||
[ $FORMAT -eq 0 ] && echo "<h3 style='color:red;' class=\"c\">$NODEVICE $DEVICE!</h3>"
|
||||
[ $FORMAT -eq 1 ] && echo "$NODEVICE $DEVICE."
|
||||
[ $FORMAT -eq 2 ] && showjsonerror "NODEVICE $DEVICE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# znajdz odpowiednia sekcje w konfiguracji
|
||||
SEC=$(uci -q get 3ginfo.@3ginfo[0].network)
|
||||
if [ -z "$SEC" ]; then
|
||||
getpath $DEVICE
|
||||
PORIG=$P
|
||||
for DEV in /sys/class/tty/* /sys/class/usbmisc/*; do
|
||||
getpath "/dev/"${DEV##/*/}
|
||||
if [ "x$PORIG" = "x$P" ]; then
|
||||
SEC=$(uci show network | grep "/dev/"${DEV##/*/} | cut -f2 -d.)
|
||||
[ -n "$SEC" ] && break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# [ "${DEVICE%%[0-9]}" = "/dev/ttyUSB" ] && stty -F $DEVICE -iexten -opost -icrnl
|
||||
|
||||
# daj pin jak jest taka potrzeba
|
||||
if [ ! -f /tmp/pincode_was_given ]; then
|
||||
# tylko za pierwszym razem
|
||||
if [ ! -z $SEC ]; then
|
||||
PINCODE=$(uci -q get network.$SEC.pincode)
|
||||
fi
|
||||
if [ -z "$PINCODE" ]; then
|
||||
PINCODE=$(uci -q get 3ginfo.@3ginfo[0].pincode)
|
||||
fi
|
||||
if [ ! -z $PINCODE ]; then
|
||||
PINCODE="$PINCODE" gcom -d "$DEVICE" -s /etc/gcom/setpin.gcom > /dev/null || {
|
||||
[ $FORMAT -eq 0 ] && echo "<h3 style='color:red;' class=\"c\">$PINERROR</h3>"
|
||||
[ $FORMAT -eq 1 ] && echo "$PINERROR"
|
||||
[ $FORMAT -eq 2 ] && showjsonerror "PINERROR"
|
||||
exit 0
|
||||
}
|
||||
fi
|
||||
touch /tmp/pincode_was_given
|
||||
fi
|
||||
|
||||
O=$(gcom -d $DEVICE -s $RES/scripts/3ginfo.gcom 2>/dev/null)
|
||||
fi
|
||||
|
||||
if [ "x$1" = "xtest" ]; then
|
||||
echo "$O"
|
||||
echo "---------------------------------------------------------------"
|
||||
ls /dev/tty*
|
||||
echo "---------------------------------------------------------------"
|
||||
cat /sys/kernel/debug/usb/devices
|
||||
echo "---------------------------------------------------------------"
|
||||
uci show 3ginfo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# CSQ
|
||||
CSQ=$(echo "$O" | awk -F[,\ ] '/^\+CSQ/ {print $2}')
|
||||
|
||||
[ "x$CSQ" = "x" ] && CSQ=-1
|
||||
if [ $CSQ -ge 0 -a $CSQ -le 31 ]; then
|
||||
|
||||
# for Gargoyle
|
||||
[ -e /tmp/strength.txt ] && echo "+CSQ: $CSQ,99" > /tmp/strength.txt
|
||||
|
||||
CSQ_PER=$(($CSQ * 100/31))
|
||||
CSQ_COL="red"
|
||||
[ $CSQ -ge 10 ] && CSQ_COL="orange"
|
||||
[ $CSQ -ge 15 ] && CSQ_COL="yellow"
|
||||
[ $CSQ -ge 20 ] && CSQ_COL="green"
|
||||
CSQ_RSSI=$((2 * CSQ - 113))
|
||||
else
|
||||
CSQ="-"
|
||||
CSQ_PER="0"
|
||||
CSQ_COL="black"
|
||||
CSQ_RSSI="-"
|
||||
fi
|
||||
|
||||
# COPS
|
||||
COPS_NUM=$(echo "$O" | awk -F[\"] '/^\+COPS: .,2/ {print $2}')
|
||||
if [ "x$COPS_NUM" = "x" ]; then
|
||||
COPS_NUM="-"
|
||||
COPS_MCC="-"
|
||||
COPS_MNC="-"
|
||||
else
|
||||
COPS_MCC=${COPS_NUM:0:3}
|
||||
COPS_MNC=${COPS_NUM:3:3}
|
||||
COPS=$(awk -F[\;] '/'$COPS_NUM'/ {print $2}' $RES/mccmnc.dat)
|
||||
[ "x$COPS" = "x" ] && COPS="-"
|
||||
fi
|
||||
|
||||
# dla modemow Option i ZTE
|
||||
if [ "$COPS_NUM" = "-" ]; then
|
||||
COPS=$(echo "$O" | awk -F[\"] '/^\+COPS: .,0/ {print $2}')
|
||||
[ "x$COPS" = "x" ] && COPS="---"
|
||||
|
||||
COPS_TMP=$(awk -F[\;] 'BEGIN {IGNORECASE = 1} /'"$COPS"'/ {print $2}' $RES/mccmnc.dat)
|
||||
if [ "x$COPS_TMP" = "x" ]; then
|
||||
COPS_NUM="-"
|
||||
COPS_MCC="-"
|
||||
COPS_MNC="-"
|
||||
else
|
||||
COPS="$COPS_TMP"
|
||||
COPS_NUM=$(awk -F[\;] 'BEGIN {IGNORECASE = 1} /'"$COPS"'/ {print $1}' $RES/mccmnc.dat)
|
||||
COPS_MCC=${COPS_NUM:0:3}
|
||||
COPS_MNC=${COPS_NUM:3:3}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Technologia
|
||||
MODE="-"
|
||||
|
||||
# Nowe Huawei
|
||||
TECH=$(echo "$O" | awk -F[,] '/^\^SYSINFOEX/ {print $9}' | sed 's/"//g')
|
||||
if [ "x$TECH" != "x" ]; then
|
||||
MODE=$(echo "$TECH" | sed 's/-//g')
|
||||
fi
|
||||
|
||||
# Starsze modele Huawei i inne pozostale
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,] '/^\^SYSINFO/ {print $7}')
|
||||
case $TECH in
|
||||
17*) MODE="HSPA+ (64QAM)";;
|
||||
18*) MODE="HSPA+ (MIMO)";;
|
||||
1*) MODE="GSM";;
|
||||
2*) MODE="GPRS";;
|
||||
3*) MODE="EDGE";;
|
||||
4*) MODE="UMTS";;
|
||||
5*) MODE="HSDPA";;
|
||||
6*) MODE="HSUPA";;
|
||||
7*) MODE="HSPA";;
|
||||
9*) MODE="HSPA+";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
fi
|
||||
|
||||
# ZTE
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,\ ] '/^\+ZPAS/ {print $2}' | sed 's/"//g')
|
||||
if [ "x$TECH" != "x" -a "x$TECH" != "xNo" ]; then
|
||||
MODE="$TECH"
|
||||
fi
|
||||
fi
|
||||
|
||||
# OPTION
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F, '/^\+COPS: 0/ {print $4}')
|
||||
MODE="-"
|
||||
if [ "$TECH" = 0 ]; then
|
||||
TECH1=$(echo "$O" | awk '/^_OCTI/ {print $2}' | cut -f1 -d,)
|
||||
case $TECH1 in
|
||||
1*) MODE="GSM";;
|
||||
2*) MODE="GPRS";;
|
||||
3*) MODE="EDGE";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
elif [ "$TECH" = 2 ]; then
|
||||
TECH1=$(echo "$O" | awk '/^_OWCTI/ {print $2}')
|
||||
case $TECH1 in
|
||||
1*) MODE="UMTS";;
|
||||
2*) MODE="HSDPA";;
|
||||
3*) MODE="HSUPA";;
|
||||
4*) MODE="HSPA";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
# Sierra
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,\ ] '/^\*CNTI/ {print $3}' | sed 's|/|,|g')
|
||||
if [ "x$TECH" != "x" ]; then
|
||||
MODE="$TECH"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Novatel
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,\ ] '/^\$CNTI/ {print $4}' | sed 's|/|,|g')
|
||||
if [ "x$TECH" != "x" ]; then
|
||||
MODE="$TECH"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Vodafone - icera
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,\ ] '/^\%NWSTATE/ {print $4}' | sed 's|/|,|g')
|
||||
if [ "x$TECH" != "x" ]; then
|
||||
MODE="$TECH"
|
||||
fi
|
||||
fi
|
||||
|
||||
# SIMCOM
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,\ ] '/^\+CNSMOD/ {print $3}')
|
||||
case "$TECH" in
|
||||
1*) MODE="GSM";;
|
||||
2*) MODE="GPRS";;
|
||||
3*) MODE="EDGE";;
|
||||
4*) MODE="UMTS";;
|
||||
5*) MODE="HSDPA";;
|
||||
6*) MODE="HSUPA";;
|
||||
7*) MODE="HSPA";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
fi
|
||||
|
||||
# generic 3GPP TS 27.007 V10.4.0
|
||||
if [ "x$MODE" = "x-" ]; then
|
||||
TECH=$(echo "$O" | awk -F[,] '/^\+COPS/ {print $4}')
|
||||
case "$TECH" in
|
||||
2*) MODE="UMTS";;
|
||||
3*) MODE="EDGE";;
|
||||
4*) MODE="HSDPA";;
|
||||
5*) MODE="HSUPA";;
|
||||
6*) MODE="HSPA";;
|
||||
7*) MODE="LTE";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
fi
|
||||
|
||||
# CREG
|
||||
CREG="+CGREG"
|
||||
LAC=$(echo "$O" | awk -F[,] '/\'$CREG'/ {printf "%s", toupper($3)}' | sed 's/[^A-F0-9]//g')
|
||||
if [ "x$LAC" = "x" ]; then
|
||||
CREG="+CREG"
|
||||
LAC=$(echo "$O" | awk -F[,] '/\'$CREG'/ {printf "%s", toupper($3)}' | sed 's/[^A-F0-9]//g')
|
||||
fi
|
||||
|
||||
if [ "x$LAC" != "x" ]; then
|
||||
LAC_NUM=$(printf %d 0x$LAC)
|
||||
else
|
||||
LAC="-"
|
||||
LAC_NUM="-"
|
||||
fi
|
||||
|
||||
# TAC
|
||||
TAC=$(echo "$O" | awk -F[,] '/^\+CEREG/ {printf "%s", toupper($3)}' | sed 's/[^A-F0-9]//g')
|
||||
if [ "x$TAC" != "x" ]; then
|
||||
TAC_NUM=$(printf %d 0x$TAC)
|
||||
else
|
||||
TAC="-"
|
||||
TAC_NUM="-"
|
||||
fi
|
||||
|
||||
|
||||
# ECIO / RSCP
|
||||
ECIO="-"
|
||||
RSCP="-"
|
||||
|
||||
ECIx=$(echo "$O" | awk -F[,\ ] '/^\+ZRSSI:/ {print $3}')
|
||||
if [ "x$ECIx" != "x" ]; then
|
||||
ECIO=`expr $ECIx / 2`
|
||||
ECIO="-"$ECIO
|
||||
fi
|
||||
|
||||
RSCx=$(echo "$O" | awk -F[,\ ] '/^\+ZRSSI:/ {print $4}')
|
||||
if [ "x$RSCx" != "x" ]; then
|
||||
RSCP=`expr $RSCx / 2`
|
||||
RSCP="-"$RSCP
|
||||
fi
|
||||
|
||||
RSCx=$(echo "$O" | awk -F[,\ ] '/^\^CSNR:/ {print $2}')
|
||||
if [ "x$RSCx" != "x" ]; then
|
||||
RSCP=$RSCx
|
||||
fi
|
||||
|
||||
ECIx=$(echo "$O" | awk -F[,\ ] '/^\^CSNR:/ {print $3}')
|
||||
if [ "x$ECIx" != "x" ]; then
|
||||
ECIO=$ECIx
|
||||
fi
|
||||
|
||||
# RSRP / RSRQ
|
||||
RSRP="-"
|
||||
RSRQ="-"
|
||||
SINR="-"
|
||||
RSRx=$(echo "$O" | awk -F[,:] '/^\^LTERSRP:/ {print $2}')
|
||||
if [ "x$RSRx" != "x" ]; then
|
||||
RSRP=$RSRx
|
||||
RSRQ=$(echo "$O" | awk -F[,:] '/^\^LTERSRP:/ {print $3}')
|
||||
fi
|
||||
|
||||
TECH=$(echo "$O" | awk -F[,:] '/^\^HCSQ:/ {print $2}' | sed 's/[" ]//g')
|
||||
if [ "x$TECH" != "x" ]; then
|
||||
PARAM2=$(echo "$O" | awk -F[,:] '/^\^HCSQ:/ {print $4}')
|
||||
PARAM3=$(echo "$O" | awk -F[,:] '/^\^HCSQ:/ {print $5}')
|
||||
PARAM4=$(echo "$O" | awk -F[,:] '/^\^HCSQ:/ {print $6}')
|
||||
|
||||
case "$TECH" in
|
||||
WCDMA*)
|
||||
RSCP=$(awk 'BEGIN {print -121 + '$PARAM2'}')
|
||||
ECIO=$(awk 'BEGIN {print -32.5 + '$PARAM3'/2}')
|
||||
;;
|
||||
LTE*)
|
||||
RSRP=$(awk 'BEGIN {print -141 + '$PARAM2'}')
|
||||
SINR=$(awk 'BEGIN {print -20.2 + '$PARAM3'/5}')
|
||||
RSRQ=$(awk 'BEGIN {print -20 + '$PARAM4'/2}')
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -n "$SEC" ]; then
|
||||
if [ "x$(uci -q get network.$SEC.proto)" = "xqmi" ]; then
|
||||
. /usr/share/libubox/jshn.sh
|
||||
json_init
|
||||
json_load "$(uqmi -d "$(uci -q get network.$SEC.device)" --get-signal-info)" >/dev/null 2>&1
|
||||
json_get_var T type
|
||||
if [ "x$T" = "xlte" ]; then
|
||||
json_get_var RSRP rsrp
|
||||
json_get_var RSRQ rsrq
|
||||
fi
|
||||
if [ "x$T" = "xwcdma" ]; then
|
||||
json_get_var ECIO ecio
|
||||
json_get_var RSSI rssi
|
||||
json_get_var RSCP rscp
|
||||
if [ -z "$RSCP" ]; then
|
||||
RSCP=$((RSSI+ECIO))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
BTSINFO=""
|
||||
CID=$(echo "$O" | awk -F[,] '/\'$CREG'/ {printf "%s", toupper($4)}' | sed 's/[^A-F0-9]//g')
|
||||
if [ "x$CID" != "x" ]; then
|
||||
CID_NUM=$(printf %d 0x$CID)
|
||||
|
||||
if [ ${#CID} -gt 4 ]; then
|
||||
T=$(echo "$CID" | awk '{print substr($1,length(substr($1,1,length($1)-4))+1)}')
|
||||
else
|
||||
T=$CID
|
||||
fi
|
||||
|
||||
CLF=$(uci -q get 3ginfo.@3ginfo[0].clf)
|
||||
if [ -e "$CLF" ]; then
|
||||
PAT="xxx"
|
||||
[ "x$T" != "x-" -a "x$LAC_NUM" != "x-" ] && PAT="^$COPS_NUM;0x"$(printf %04X 0x$T)";0x"$(printf %04X $LAC_NUM)";"
|
||||
is_gz=$(dd if="$CLF" bs=1 count=2 2>/dev/null | hexdump -v -e '1/1 "%02x"')
|
||||
if [ "x$is_gz" = "x1f8b" ] ; then
|
||||
BTSINFO="<a href=\"http://maps.google.pl/?t=k\&z=17\&q="$(zcat "$CLF" | awk -F";" '/'$PAT'/ {printf $5","$6}')"\">"$(zcat "$CLF" | awk -F";" '/'$PAT'/ {gsub(/\!/,"\\!");print $8}')"</a>"
|
||||
else
|
||||
BTSINFO="<a href=\"http://maps.google.pl/?t=k\&z=17\&q="$(awk -F";" '/'$PAT'/ {printf $5","$6}' "$CLF")"\">"$(awk -F";" '/'$PAT'/ {gsub(/\!/,"\\!");print $8}' "$CLF")"</a>"
|
||||
fi
|
||||
if [ $FORMAT -eq 2 ]; then
|
||||
BTSINFO=$(echo "$BTSINFO" | sed 's!<a.*>\(.*\)</a>!\1!g')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $FORMAT -eq 0 ]; then
|
||||
case $COPS_NUM in
|
||||
26001*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=3\&mode=adv\">$CID</a>";;
|
||||
26002*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=-1\&mode=adv\">$CID</a>";;
|
||||
26003*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=-1\&mode=adv\">$CID</a>";;
|
||||
26006*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=4\&mode=adv\">$CID</a>";;
|
||||
26016*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=7\&mode=adv\">$CID</a>";;
|
||||
26017*) CID="<a href=\"http://btsearch.pl/szukaj.php?search="$CID"h\&siec=8\&mode=adv\">$CID</a>";;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
CID="-"
|
||||
CID_NUM="-"
|
||||
fi
|
||||
|
||||
# CGEQNEG
|
||||
QOS_SHOW="none"
|
||||
DOWN="-"
|
||||
UP="-"
|
||||
|
||||
DOWx=$(echo "$O" | awk -F[,] '/\+CGEQNEG/ {printf "%s", $4}')
|
||||
if [ "x$DOWx" != "x" ]; then
|
||||
DOWN=$DOWx
|
||||
UP=$(echo "$O" | awk -F[,] '/\+CGEQNEG/ {printf "%s", $3}')
|
||||
QOS_SHOW="block"
|
||||
fi
|
||||
|
||||
# SMS
|
||||
if [ -e /usr/bin/gnokii ]; then
|
||||
SMS_SHOW="block"
|
||||
else
|
||||
SMS_SHOW="none"
|
||||
fi
|
||||
|
||||
# USSD
|
||||
which ussd159 >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
USSD_SHOW="block"
|
||||
else
|
||||
USSD_SHOW="none"
|
||||
fi
|
||||
|
||||
# Stan limitu
|
||||
LIMIT_SHOW="none"
|
||||
LIMIT=$(uci -q get 3ginfo.@3ginfo[0].script)
|
||||
if [ "x$LIMIT" != "x" ]; then
|
||||
LIMIT_SHOW="block"
|
||||
fi
|
||||
|
||||
# Status polaczenia
|
||||
|
||||
CONN_TIME="-"
|
||||
RX="-"
|
||||
TX="-"
|
||||
|
||||
if [ -z "$SEC" ]; then
|
||||
STATUS=$NOINFO
|
||||
[ $FORMAT -eq 2 ] && STATUS="NOINFO"
|
||||
|
||||
STATUS_TRE="-"
|
||||
STATUS_SHOW="none"
|
||||
STATUS_SHOW_BUTTON="none"
|
||||
else
|
||||
NETUP=$(ifstatus $SEC | grep "\"up\": true")
|
||||
if [ -n "$NETUP" ]; then
|
||||
[ $FORMAT -eq 0 ] && STATUS="<font color=green>$CONNECTED</font>"
|
||||
[ $FORMAT -eq 1 ] && STATUS=$CONNECTED
|
||||
[ $FORMAT -eq 2 ] && STATUS="CONNECTED"
|
||||
STATUS_TRE=$DISCONNECT
|
||||
|
||||
CT=$(uci -q -P /var/state/ get network.$SEC.connect_time)
|
||||
if [ -z $CT ]; then
|
||||
CT=$(ifstatus $SEC | awk -F[:,] '/uptime/ {print $2}' | xargs)
|
||||
else
|
||||
UPTIME=$(cut -d. -f1 /proc/uptime)
|
||||
CT=$((UPTIME-CT))
|
||||
fi
|
||||
if [ ! -z $CT ]; then
|
||||
D=$(expr $CT / 60 / 60 / 24)
|
||||
H=$(expr $CT / 60 / 60 % 24)
|
||||
M=$(expr $CT / 60 % 60)
|
||||
S=$(expr $CT % 60)
|
||||
CONN_TIME=$(printf "%dd, %02d:%02d:%02d" $D $H $M $S)
|
||||
fi
|
||||
IFACE=$(ifstatus $SEC | awk -F\" '/l3_device/ {print $4}')
|
||||
if [ -n "$IFACE" ]; then
|
||||
RX=$(ifconfig $IFACE | awk -F[\(\)] '/bytes/ {printf "%s",$2}')
|
||||
TX=$(ifconfig $IFACE | awk -F[\(\)] '/bytes/ {printf "%s",$4}')
|
||||
fi
|
||||
else
|
||||
|
||||
[ $FORMAT -eq 0 ] && STATUS="<font color=red>$DISCONNECTED</font>"
|
||||
[ $FORMAT -eq 1 ] && STATUS=$DISCONNECTED
|
||||
[ $FORMAT -eq 2 ] && STATUS="DISCONNECTED"
|
||||
STATUS_TRE=$CONNECT
|
||||
fi
|
||||
STATUS_SHOW="block"
|
||||
STATUS_SHOW_BUTTON="block"
|
||||
fi
|
||||
|
||||
if [ "x"$(uci -q get 3ginfo.@3ginfo[0].connect_button) = "x0" ]; then
|
||||
STATUS_SHOW_BUTTON="none"
|
||||
fi
|
||||
|
||||
# Informacja o urzadzeniu
|
||||
DEVICE=$(echo "$O" | awk -F[:] '/DEVICE/ { print $2}')
|
||||
if [ "x$DEVICE" = "x" ]; then
|
||||
DEVICE="-"
|
||||
fi
|
||||
|
||||
# podmiana w szablonie
|
||||
if [ $FORMAT -eq 2 ]; then
|
||||
TEMPLATE="$RES/status.json"
|
||||
else
|
||||
[ $FORMAT -eq 0 ] && EXT="html"
|
||||
[ $FORMAT -eq 1 ] && EXT="txt"
|
||||
TEMPLATE="$RES/status.$EXT.$LANG"
|
||||
fi
|
||||
|
||||
if [ -e $TEMPLATE ]; then
|
||||
sed -e "s!{CSQ}!$CSQ!g; \
|
||||
s!{CSQ_PER}!$CSQ_PER!g; \
|
||||
s!{CSQ_RSSI}!$CSQ_RSSI!g; \
|
||||
s!{CSQ_COL}!$CSQ_COL!g; \
|
||||
s!{COPS}!$COPS!g; \
|
||||
s!{COPS_NUM}!$COPS_NUM!g; \
|
||||
s!{COPS_MCC}!$COPS_MCC!g; \
|
||||
s!{COPS_MNC}!$COPS_MNC!g; \
|
||||
s!{LAC}!$LAC!g; \
|
||||
s!{LAC_NUM}!$LAC_NUM!g; \
|
||||
s!{CID}!$CID!g; \
|
||||
s!{CID_NUM}!$CID_NUM!g; \
|
||||
s!{TAC}!$TAC!g; \
|
||||
s!{TAC_NUM}!$TAC_NUM!g; \
|
||||
s!{BTSINFO}!$BTSINFO!g; \
|
||||
s!{DOWN}!$DOWN!g; \
|
||||
s!{UP}!$UP!g; \
|
||||
s!{QOS_SHOW}!$QOS_SHOW!g; \
|
||||
s!{SMS_SHOW}!$SMS_SHOW!g; \
|
||||
s!{USSD_SHOW}!$USSD_SHOW!g; \
|
||||
s!{LIMIT_SHOW}!$LIMIT_SHOW!g; \
|
||||
s!{STATUS}!$STATUS!g; \
|
||||
s!{CONN_TIME}!$CONN_TIME!g; \
|
||||
s!{CONN_TIME_SEC}!$CT!g; \
|
||||
s!{RX}!$RX!g; \
|
||||
s!{TX}!$TX!g; \
|
||||
s!{STATUS_TRE}!$STATUS_TRE!g; \
|
||||
s!{STATUS_SHOW}!$STATUS_SHOW!g; \
|
||||
s!{STATUS_SHOW_BUTTON}!$STATUS_SHOW_BUTTON!g; \
|
||||
s!{DEVICE}!$DEVICE!g; \
|
||||
s!{ECIO}!$ECIO!g; \
|
||||
s!{RSCP}!$RSCP!g; \
|
||||
s!{RSRP}!$RSRP!g; \
|
||||
s!{RSRQ}!$RSRQ!g; \
|
||||
s!{SINR}!$SINR!g; \
|
||||
s!{MODE}!$MODE!g" $TEMPLATE
|
||||
else
|
||||
echo "Template $TEMPLATE missing!"
|
||||
fi
|
||||
|
||||
exit 0
|
1751
3ginfo/files-text/usr/share/3ginfo/mccmnc.dat
Normal file
8
3ginfo/files-text/usr/share/3ginfo/msg.dat.en
Normal file
@ -0,0 +1,8 @@
|
||||
NOTDETECTED="Not detected any device"
|
||||
NODEVICE="No device"
|
||||
PINERROR="PIN code error"
|
||||
CONNECTED="Connected"
|
||||
CONNECT="Connect"
|
||||
DISCONNECTED="Disconnected"
|
||||
DISCONNECT="Disconnect"
|
||||
NOINFO="No information"
|
8
3ginfo/files-text/usr/share/3ginfo/msg.dat.it
Normal file
@ -0,0 +1,8 @@
|
||||
NOTDETECTED="Nessun dispositivo trovato"
|
||||
NODEVICE="Nessun dispositivo"
|
||||
PINERROR="Errore codice PIN"
|
||||
CONNECTED="Connesso"
|
||||
CONNECT="Connetti"
|
||||
DISCONNECTED="Disconnesso"
|
||||
DISCONNECT="Disconnetti"
|
||||
NOINFO="Nessuna Informazione"
|
8
3ginfo/files-text/usr/share/3ginfo/msg.dat.pl
Normal file
@ -0,0 +1,8 @@
|
||||
NOTDETECTED="Nie wykryto żadnego urządzenia!"
|
||||
NODEVICE="Brak urządzenia"
|
||||
PINERROR="Błąd kodu PIN"
|
||||
CONNECTED="Połączony"
|
||||
CONNECT="Połącz"
|
||||
DISCONNECTED="Rozłączony"
|
||||
DISCONNECT="Rozłącz"
|
||||
NOINFO="Brak informacji"
|
176
3ginfo/files-text/usr/share/3ginfo/scripts/3ginfo.gcom
Normal file
@ -0,0 +1,176 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT\^CURC=0^m"
|
||||
waitfor 5 "OK","ERROR"
|
||||
|
||||
let $c="AT+CSQ^m"
|
||||
let $r="+CSQ"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="ATE1; +CGMI^m"
|
||||
gosub readatcmdnr
|
||||
let $v=$s
|
||||
|
||||
if $toupper($mid($v,0,3)) = "HUA" goto huawei
|
||||
if $toupper($mid($v,0,3)) = "NOK" goto vodafone
|
||||
if $toupper($mid($v,0,3)) = "NOV" goto novatel
|
||||
if $toupper($mid($v,0,3)) = "OPT" goto option
|
||||
if $toupper($mid($v,0,3)) = "QUA" goto qualcomm
|
||||
if $toupper($mid($v,0,3)) = "SIM" goto simcom
|
||||
if $toupper($mid($v,0,3)) = "SIE" goto sierra
|
||||
if $toupper($mid($v,0,3)) = "VOD" goto vodafone
|
||||
if $toupper($mid($v,0,3)) = "ZTE" goto zte
|
||||
goto generic
|
||||
|
||||
:simcom
|
||||
let $c="AT+CNSMOD?^m"
|
||||
let $r="+CNSMOD"
|
||||
gosub readatcmd
|
||||
goto next
|
||||
|
||||
:vodafone
|
||||
let $c="AT%NWSTATE=1^m"
|
||||
let $r="%NWSTATE"
|
||||
gosub readatcmd
|
||||
goto next
|
||||
|
||||
:novatel
|
||||
let $c="AT$CNTI=0^m"
|
||||
let $r="$CNTI"
|
||||
gosub readatcmd
|
||||
goto next
|
||||
|
||||
:sierra
|
||||
let $c="AT*CNTI=0^m"
|
||||
let $r="*CNTI"
|
||||
gosub readatcmd
|
||||
goto next
|
||||
|
||||
:option
|
||||
let $c="AT_OCTI?^m"
|
||||
let $r="_OCTI"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT_OWCTI?^m"
|
||||
let $r="_OWCTI"
|
||||
gosub readatcmd
|
||||
goto next
|
||||
|
||||
:qualcomm
|
||||
let $c="AT+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
goto next1
|
||||
|
||||
:zte
|
||||
let $c="AT+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+ZRSSI^m"
|
||||
let $r="+ZRSSI"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+ZPAS?^m"
|
||||
let $r="+ZPAS"
|
||||
gosub readatcmd
|
||||
goto next1
|
||||
|
||||
:huawei
|
||||
let $c="AT\^SYSINFOEX^m"
|
||||
let $r="\^SYSINFOEX"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT\^CSNR?^m"
|
||||
let $r="\^CSNR"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT\^LTERSRP?^m"
|
||||
let $r="\^LTERSRP"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT\^HCSQ?^m"
|
||||
let $r="\^HCSQ"
|
||||
gosub readatcmd
|
||||
|
||||
:generic
|
||||
let $c="AT\^SYSINFO^m"
|
||||
let $r="\^SYSINFO"
|
||||
gosub readatcmd
|
||||
|
||||
:next
|
||||
let $c="AT+COPS=3,2;+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
:next1
|
||||
let $c="AT+CREG=2;+CREG?^m"
|
||||
let $r="+CREG"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CGREG=2;+CGREG?^m"
|
||||
let $r="+CGREG"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CEREG=2;+CEREG?^m"
|
||||
let $r="+CEREG"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CGEQNEG=1^m"
|
||||
let $r="+CGEQNEG"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="ATE1; +CGMM^m"
|
||||
gosub readatcmdnr
|
||||
print "\nDEVICE:",$v," ",$s,"\n"
|
||||
|
||||
exit 0
|
||||
|
||||
:readatcmd
|
||||
let i=15
|
||||
send $c
|
||||
:loop
|
||||
get 0.1 "^m" $s
|
||||
let l=len($r)
|
||||
if len($s) < l goto loop1
|
||||
if $mid($s,1,l) <> $r goto loop1
|
||||
print $s
|
||||
return
|
||||
|
||||
:loop1
|
||||
if len($s) < 2 goto loop2
|
||||
if $mid($s,1,2) = "ER" return
|
||||
if $mid($s,1,2) = "CO" return
|
||||
:loop2
|
||||
if i = 0 return
|
||||
let i=i-1
|
||||
goto loop
|
||||
|
||||
:readatcmdnr
|
||||
let i=15
|
||||
send $c
|
||||
:loop3
|
||||
get 0.1 "^m" $s
|
||||
if len($s) < 2 goto loop5
|
||||
if $mid($s,1,2) = "ER" goto loop4
|
||||
if $mid($s,1,2) = "OK" goto loop5
|
||||
if $mid($s,1,2) = "AT" goto loop5
|
||||
if $mid($s,1,2) = "TE" goto loop5
|
||||
if $mid($s,1,1) = "+" goto loop5
|
||||
if $mid($s,1,1) = "\^" goto loop5
|
||||
let l=len($s)
|
||||
let $s=$mid($s,1,l)
|
||||
return
|
||||
|
||||
:loop4
|
||||
let $s=""
|
||||
return
|
||||
|
||||
:loop5
|
||||
if i = 0 return
|
||||
let i=i-1
|
||||
goto loop3
|
60
3ginfo/files-text/usr/share/3ginfo/scripts/alcatel_hilink.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
|
||||
IP=$1
|
||||
[ -z "$IP" ] && exit 0
|
||||
[ -e /usr/bin/wget ] || exit 0
|
||||
|
||||
getvaluen() {
|
||||
echo $(sed 's!.*"'$2'":\([^,]*\).*!\1!g' /tmp/$1)
|
||||
}
|
||||
|
||||
getvalue() {
|
||||
echo $(sed 's!.*"'$2'":"\([^"]*\).*!\1!g' /tmp/$1)
|
||||
}
|
||||
|
||||
rand=`awk 'BEGIN{srand();print int(rand()*(99000-1000))+1000 }'`
|
||||
|
||||
files="getWanInfo getImgInfo getSysteminfo"
|
||||
for f in $files; do
|
||||
wget -t 3 -O /tmp/$f "http://$IP/goform/$f?rand=$rand" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
MODEN=$(getvaluen getWanInfo "network_type")
|
||||
case $MODEN in
|
||||
1) MODE="GPRS";;
|
||||
2) MODE="EDGE";;
|
||||
3) MODE="HSDPA";;
|
||||
4) MODE="HSUPA";;
|
||||
5) MODE="UMTS";;
|
||||
9) MODE="GSM";;
|
||||
11) MODE="LTE";;
|
||||
12) MODE="HSPA+";;
|
||||
13) MODE="DC HSPA+";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
echo "^SYSINFOEX:x,x,x,x,,x,\"$MODE\",$MODEN,\"$MODE\""
|
||||
|
||||
OPER=$(getvalue getWanInfo "network_name")
|
||||
echo "+COPS: 0,0,\"$OPER\",x"
|
||||
|
||||
SIGNAL=$(getvaluen getImgInfo "signal")
|
||||
case $SIGNAL in
|
||||
1) CSQ="6";;
|
||||
2) CSQ="12";;
|
||||
3) CSQ="18";;
|
||||
4) CSQ="24";;
|
||||
5) CSQ="31";;
|
||||
*) CSQ="0";;
|
||||
esac
|
||||
echo "+CSQ: $CSQ,99"
|
||||
|
||||
MODEL=$(getvalue getSysteminfo "dev_name")
|
||||
echo "DEVICE:Alcatel $MODEL"
|
||||
|
||||
if [ "x$2" != "xdebug" ]; then
|
||||
for f in $files; do
|
||||
rm /tmp/$f
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
159
3ginfo/files-text/usr/share/3ginfo/scripts/huawei_hilink.sh
Normal file
@ -0,0 +1,159 @@
|
||||
#!/bin/sh
|
||||
|
||||
IP=$1
|
||||
[ -z "$IP" ] && exit 0
|
||||
[ -e /usr/bin/wget ] || exit 0
|
||||
|
||||
getvaluen() {
|
||||
echo $(awk -F[\<\>] '/<'$2'>/ {print $3}' /tmp/$1 | sed 's/[^0-9]//g')
|
||||
}
|
||||
|
||||
getvaluens() {
|
||||
echo $(awk -F[\<\>] '/<'$2'>/ {print $3}' /tmp/$1 | sed 's/[^0-9-]//g')
|
||||
}
|
||||
|
||||
getvalue() {
|
||||
echo $(awk -F[\<\>] '/<'$2'>/ {print $3}' /tmp/$1)
|
||||
}
|
||||
|
||||
cookie=$(mktemp)
|
||||
/usr/bin/wget -t 25 -O /tmp/webserver-token "http://$IP/api/webserver/token" >/dev/null 2>&1
|
||||
token=$(getvaluen webserver-token token)
|
||||
if [ -z "$token" ]; then
|
||||
/usr/bin/wget -t 25 -O /tmp/webserver-token "http://$IP/api/webserver/SesTokInfo" >/dev/null 2>&1
|
||||
sesinfo=$(getvalue webserver-token SesInfo)
|
||||
fi
|
||||
if [ -z "$sesinfo" ]; then
|
||||
/usr/bin/wget -q -O /dev/null --keep-session-cookies --save-cookies $cookie "http://$IP/html/home.html"
|
||||
fi
|
||||
|
||||
files="device/signal monitoring/status net/current-plmn net/signal-para device/information device/basic_information"
|
||||
for f in $files; do
|
||||
nf=$(echo $f | sed 's!/!-!g')
|
||||
if [ -n "$token" ]; then
|
||||
/usr/bin/wget -t 3 -O /tmp/$nf "http://$IP/api/$f" --header "__RequestVerificationToken: $token" >/dev/null 2>&1
|
||||
elif [ -n "$sesinfo" ]; then
|
||||
/usr/bin/wget -t 3 -O /tmp/$nf "http://$IP/api/$f" --header "Cookie: $sesinfo" >/dev/null 2>&1
|
||||
else
|
||||
/usr/bin/wget -t 3 -O /tmp/$nf "http://$IP/api/$f" --load-cookies=$cookie >/dev/null 2>&1
|
||||
fi
|
||||
done
|
||||
|
||||
rssi=$(getvaluen device-signal rssi)
|
||||
if [ -n "$rssi" ]; then
|
||||
CSQ=$(((-1*rssi + 113)/2))
|
||||
echo "+CSQ: $CSQ,99"
|
||||
else
|
||||
per=$(getvaluen monitoring-status SignalStrength)
|
||||
if [ -n "$per" ]; then
|
||||
CSQ=$((($per*31)/100))
|
||||
echo "+CSQ: $CSQ,99"
|
||||
fi
|
||||
fi
|
||||
|
||||
MODEN=$(getvaluen monitoring-status CurrentNetworkType)
|
||||
case $MODEN in
|
||||
1) MODE="GSM";;
|
||||
2) MODE="GPRS";;
|
||||
3) MODE="EDGE";;
|
||||
4) MODE="WCDMA";;
|
||||
5) MODE="HSDPA";;
|
||||
6) MODE="HSUPA";;
|
||||
7) MODE="HSPA";;
|
||||
8) MODE="TDSCDMA";;
|
||||
9) MODE="HSPA+";;
|
||||
10) MODE="EVDO rev. 0";;
|
||||
11) MODE="EVDO rev. A";;
|
||||
12) MODE="EVDO rev. B";;
|
||||
13) MODE="1xRTT";;
|
||||
14) MODE="UMB";;
|
||||
15) MODE="1xEVDV";;
|
||||
16) MODE="3xRTT";;
|
||||
17) MODE="HSPA+64QAM";;
|
||||
18) MODE="HSPA+MIMO";;
|
||||
19) MODE="LTE";;
|
||||
21) MODE="IS95A";;
|
||||
22) MODE="IS95B";;
|
||||
23) MODE="CDMA1x";;
|
||||
24) MODE="EVDO rev. 0";;
|
||||
25) MODE="EVDO rev. A";;
|
||||
26) MODE="EVDO rev. B";;
|
||||
27) MODE="Hybrydowa CDMA1x";;
|
||||
28) MODE="Hybrydowa EVDO rev. 0";;
|
||||
29) MODE="Hybrydowa EVDO rev. A";;
|
||||
30) MODE="Hybrydowa EVDO rev. B";;
|
||||
31) MODE="EHRPD rev. 0";;
|
||||
32) MODE="EHRPD rev. A";;
|
||||
33) MODE="EHRPD rev. B";;
|
||||
34) MODE="Hybrydowa EHRPD rev. 0";;
|
||||
35) MODE="Hybrydowa EHRPD rev. A";;
|
||||
36) MODE="Hybrydowa EHRPD rev. B";;
|
||||
41) MODE="WCDMA (UMTS)";;
|
||||
42) MODE="HSDPA";;
|
||||
43) MODE="HSUPA";;
|
||||
44) MODE="HSPA";;
|
||||
45) MODE="HSPA+";;
|
||||
46) MODE="DC-HSPA+";;
|
||||
61) MODE="TD SCDMA";;
|
||||
62) MODE="TD HSDPA";;
|
||||
63) MODE="TD HSUPA";;
|
||||
64) MODE="TD HSPA";;
|
||||
65) MODE="TD HSPA+";;
|
||||
81) MODE="802.16E";;
|
||||
101) MODE="LTE";;
|
||||
*) MODE="-";;
|
||||
esac
|
||||
echo "^SYSINFOEX:x,x,x,x,,x,\"$MODE\",$MODEN,\"$MODE\""
|
||||
|
||||
numeric=$(getvaluen net-current-plmn Numeric)
|
||||
echo "+COPS: 0,2,\"$numeric\",x"
|
||||
|
||||
lac=$(getvalue net-signal-para Lac)
|
||||
if [ -z "$lac" ]; then
|
||||
/usr/bin/wget -t 3 -O /tmp/add-param "http://$IP/config/deviceinformation/add_param.xml" > /dev/null 2>&1
|
||||
lac=$(getvalue add-param lac)
|
||||
rm /tmp/add-param
|
||||
fi
|
||||
cid=$(getvalue net-signal-para CellID)
|
||||
if [ -z "$cid" ]; then
|
||||
cell_id=$(getvalue device-signal cell_id)
|
||||
cid=""
|
||||
[ -n "$cell_id" ] && cid=$(printf %0X $cell_id)
|
||||
fi
|
||||
echo "+CREG: 2,1,\"$lac\",\"$cid\""
|
||||
|
||||
if [ "x$MODE" = "xLTE" ]; then
|
||||
rsrp=$(getvaluens device-signal rsrp)
|
||||
sinr=$(getvaluens device-signal sinr)
|
||||
rsrq=$(getvaluens device-signal rsrq)
|
||||
rsrp=$(awk 'BEGIN {print '$rsrp' + 141}')
|
||||
sinr=$(awk 'BEGIN {print ('$sinr'+20.2)*5}')
|
||||
rsrq=$(awk 'BEGIN {print ('$rsrq'+20)*2}')
|
||||
echo "^HCSQ: \"$MODE\",$rssi,$rsrp,$sinr,$rsrq"
|
||||
else
|
||||
rscp=$(getvaluens device-signal rscp)
|
||||
[ -z "$rscp" ] && rscp=$(getvaluens net-signal-para Rscp)
|
||||
ecio=$(getvaluens net-signal-para ecio)
|
||||
[ -z "$ecio" ] && ecio=$(getvaluens net-signal-para Ecio)
|
||||
echo "^CSNR: $rscp,$ecio"
|
||||
fi
|
||||
|
||||
device=$(getvalue device-information DeviceName)
|
||||
if [ -n "$device" ]; then
|
||||
class=$(getvalue device-information Classify)
|
||||
echo "DEVICE:Huawei $device $class"
|
||||
else
|
||||
device=$(getvalue device-basic_information devicename)
|
||||
class=$(getvalue device-basic_information classify)
|
||||
[ -n "$device" ] && echo "DEVICE:Huawei $device $class"
|
||||
fi
|
||||
|
||||
if [ "x$2" != "xdebug" ]; then
|
||||
for f in $files webserver/token; do
|
||||
nf=$(echo $f | sed 's!/!-!g')
|
||||
rm /tmp/$nf
|
||||
done
|
||||
fi
|
||||
rm $cookie
|
||||
|
||||
exit 0
|
14
3ginfo/files-text/usr/share/3ginfo/scripts/probeport.gcom
Normal file
@ -0,0 +1,14 @@
|
||||
let $d = $env("DEVICE")
|
||||
if $d = "" goto timeout
|
||||
|
||||
open com $d
|
||||
set com 115200n81
|
||||
set senddelay 0.05
|
||||
waitquiet 2 0.5
|
||||
send "AT^m"
|
||||
waitfor 2 "OK" "+CME ERROR"
|
||||
if % = -1 goto timeout
|
||||
exit 0
|
||||
|
||||
:timeout
|
||||
exit 1
|
50
3ginfo/files-text/usr/share/3ginfo/scripts/zte.sh
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
IP=$1
|
||||
[ -z "$IP" ] && exit 0
|
||||
|
||||
T=$(mktemp)
|
||||
wget -q -O $T "http://$IP/goform/goform_get_cmd_process?multi_data=1&cmd=manufacturer_name,model_name,network_provider,network_type,lte_rsrp,lte_rsrq,lte_rssi,lte_snr,cell_id,lac_code,hmcc,hmnc,rmcc,rmnc,rssi,rscp,ecio"
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
json_load "$(cat $T)"
|
||||
|
||||
json_get_vars manufacturer_name model_name network_provider network_type lte_rsrp lte_rsrq lte_rssi lte_snr cell_id lac_code hmcc hmnc rmcc rmnc rssi rscp ecio
|
||||
|
||||
if [ -n "$lte_rssi" ]; then
|
||||
rssi=$lte_rssi
|
||||
fi
|
||||
if [ -n "$rssi" ]; then
|
||||
CSQ=$(((rssi+113)/2))
|
||||
else
|
||||
CSQ=0
|
||||
fi
|
||||
echo "+CSQ: $CSQ,99"
|
||||
|
||||
echo "DEVICE:$manufacturer_name $model_name"
|
||||
|
||||
echo "^SYSINFOEX:x,x,x,x,,x,\"$network_type\",x,\"$network_type\""
|
||||
|
||||
if [ -n "$hmcc" ]; then
|
||||
mcc=$(printf "%03d" $hmcc)
|
||||
else
|
||||
[ -n "$rmcc" ] && mcc=$(printf "%03d" $rmcc)
|
||||
fi
|
||||
|
||||
if [ -n "$hmnc" ]; then
|
||||
mnc=$(printf "%02d" $hmnc)
|
||||
else
|
||||
[ -n "$rmnc" ] && mnc=$(printf "%02d" $rmnc)
|
||||
fi
|
||||
echo "+COPS: 0,2,\"$mcc$mnc\",x"
|
||||
|
||||
if [ "x$network_type" = "xLTE" ]; then
|
||||
echo "^LTERSRP: $lte_rsrp,$lte_rsrq"
|
||||
else
|
||||
echo "^CSNR: $rscp,$ecio"
|
||||
fi
|
||||
|
||||
echo "+CREG: 2,1,\"$lac_code\",\"$cell_id\""
|
||||
|
||||
rm $T
|
||||
exit 0
|
31
3ginfo/files-text/usr/share/3ginfo/status.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"error": "",
|
||||
"csq": "{CSQ}",
|
||||
"signal": "{CSQ_PER}",
|
||||
"rssi": "{CSQ_RSSI}",
|
||||
"mode": "{MODE}",
|
||||
"device": "{DEVICE}",
|
||||
"operator_name": "{COPS}",
|
||||
"operator": "{COPS_NUM}",
|
||||
"operator_mcc": "{COPS_MCC}",
|
||||
"operator_mnc": "{COPS_MNC}",
|
||||
"lac_hex": "{LAC}",
|
||||
"lac_dec": "{LAC_NUM}",
|
||||
"cid_hex": "{CID}",
|
||||
"cid_dec": "{CID_NUM}",
|
||||
"tac_hex": "{TAC}",
|
||||
"tac_dec": "{TAC_NUM}",
|
||||
"bts_info": "{BTSINFO}",
|
||||
"bts_qos_down": "{DOWN}",
|
||||
"bts_qos_up": "{UP}",
|
||||
"status": "{STATUS}",
|
||||
"conn_time": "{CONN_TIME}",
|
||||
"conn_time_sec": "{CONN_TIME_SEC}",
|
||||
"iface_rx": "{RX}",
|
||||
"iface_tx": "{TX}",
|
||||
"rscp": "{RSCP}",
|
||||
"ecio": "{ECIO}",
|
||||
"rsrp": "{RSRP}",
|
||||
"sinr": "{SINR}",
|
||||
"rsrq": "{RSRQ}"
|
||||
}
|
18
3ginfo/files-text/usr/share/3ginfo/status.txt.en
Normal file
@ -0,0 +1,18 @@
|
||||
Status: {STATUS}
|
||||
Connection time: {CONN_TIME}
|
||||
Received / Transmitted data: {RX} / {TX}
|
||||
Operator: {COPS}
|
||||
Operating mode: {MODE}
|
||||
Signal strength: {CSQ_PER}%
|
||||
Device: {DEVICE}
|
||||
MCC MNC: {COPS_MCC} {COPS_MNC}
|
||||
LAC: {LAC} ({LAC_NUM})
|
||||
CID: {CID} ({CID_NUM})
|
||||
TAC: {TAC} ({TAC_NUM})
|
||||
CSQ: {CSQ}
|
||||
RSSI: {CSQ_RSSI} dBm
|
||||
RSCP: {RSCP} dBm
|
||||
Ec/IO: {ECIO} dB
|
||||
RSRP: {RSRP} dBm
|
||||
SINR: {SINR} dB
|
||||
RSRQ: {RSRQ} dB
|
18
3ginfo/files-text/usr/share/3ginfo/status.txt.it
Normal file
@ -0,0 +1,18 @@
|
||||
Stato: {STATUS}
|
||||
Tempo di connessione: {CONN_TIME}
|
||||
Dati ricevuti / Trasmessi: {RX} / {TX}
|
||||
Operatore: {COPS}
|
||||
Tipo di connessione: {MODE}
|
||||
Forza segnale: {CSQ_PER}%
|
||||
Dispositivo: {DEVICE}
|
||||
MCC MNC: {COPS_MCC} {COPS_MNC}
|
||||
LAC: {LAC} ({LAC_NUM})
|
||||
CID: {CID} ({CID_NUM})
|
||||
TAC: {TAC} ({TAC_NUM})
|
||||
CSQ: {CSQ}
|
||||
RSSI: {CSQ_RSSI} dBm
|
||||
RSCP: {RSCP} dBm
|
||||
Ec/IO: {ECIO} dB
|
||||
RSRP: {RSRP} dBm
|
||||
SINR: {SINR} dB
|
||||
RSRQ: {RSRQ} dB
|
18
3ginfo/files-text/usr/share/3ginfo/status.txt.pl
Normal file
@ -0,0 +1,18 @@
|
||||
Status: {STATUS}
|
||||
Czas polaczenia: {CONN_TIME}
|
||||
Przeslano danych: {RX} / {TX}
|
||||
Operator: {COPS}
|
||||
Tryb pracy: {MODE}
|
||||
Sila sygnalu: {CSQ_PER}%
|
||||
Urzadzenie: {DEVICE}
|
||||
MCC MNC: {COPS_MCC} {COPS_MNC}
|
||||
LAC: {LAC} ({LAC_NUM})
|
||||
CID: {CID} ({CID_NUM})
|
||||
TAC: {TAC} ({TAC_NUM})
|
||||
CSQ: {CSQ}
|
||||
RSSI: {CSQ_RSSI} dBm
|
||||
RSCP: {RSCP} dBm
|
||||
Ec/IO: {ECIO} dB
|
||||
RSRP: {RSRP} dBm
|
||||
SINR: {SINR} dB
|
||||
RSRQ: {RSRQ} dB
|
11
3ginfo/files/etc/init.d/3ginfo
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# (c) 2010-2019 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
|
||||
START=99
|
||||
|
||||
start () {
|
||||
PORT=$(uci -q get 3ginfo.@3ginfo[0].http_port)
|
||||
[ -z $PORT ] && { PORT=81; }
|
||||
uhttpd -c /usr/share/3ginfo/uhttpd.conf -h /usr/share/3ginfo/ -p 0.0.0.0:$PORT > /dev/null 2>&1
|
||||
}
|
19
3ginfo/files/usr/share/3ginfo/cgi-bin/limit.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
DEVICE=$(uci get 3ginfo.@3ginfo[0].device)
|
||||
SCRIPT=$(uci get 3ginfo.@3ginfo[0].script)
|
||||
|
||||
echo -e "Content-type: text/html\n\n"
|
||||
if [ -e scripts/$SCRIPT.sh ]; then
|
||||
sh scripts/$SCRIPT.sh
|
||||
elif [ -e scripts/$SCRIPT.gcom ]; then
|
||||
if ! pidof gcom > /dev/null; then
|
||||
O=$(gcom -d $DEVICE -s scripts/$SCRIPT.gcom)
|
||||
echo "<div class=\"c\">$O</div>"
|
||||
else
|
||||
echo "<div class=\"c\">Brak możliwości sprawdzenia limitu. Spróbuj za chwilę.</div>"
|
||||
fi
|
||||
else
|
||||
echo "<div class=\"c\"><font color=red>Brak skryptu $SCRIPT</font></div>"
|
||||
fi
|
||||
echo "<div class=\"c\"><input type=\"button\" class=\"button\" value=\"Wróć\" onclick=\"trzyginfo('cgi-bin/3ginfo.sh');\"></div>"
|
17
3ginfo/files/usr/share/3ginfo/cgi-bin/onoff.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
SEC=$(uci -q get 3ginfo.@3ginfo[0].network)
|
||||
[ -z "$SEC" ] && exit 0
|
||||
|
||||
ALLOW=$(uci -q get 3ginfo.@3ginfo[0].connect_button)
|
||||
[ "x$ALLOW" = "x0" ] && exit 0
|
||||
|
||||
UP=$(ifstatus $SEC | grep "\"up\": true")
|
||||
if [ -n "$UP" ]; then
|
||||
ifdown $SEC > /dev/null 2>&1
|
||||
else
|
||||
ifup $SEC > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
exit 0
|
6
3ginfo/files/usr/share/3ginfo/cgi-bin/signal.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
D=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
echo -e "Content-type: text/html\n\n"
|
||||
if [ -e $D ]; then
|
||||
gcom -d $D sig | sed -e 's/ /,/g'
|
||||
fi
|
96
3ginfo/files/usr/share/3ginfo/cgi-bin/sms.sh
Normal file
@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Content-type: text/html"
|
||||
echo ""
|
||||
echo "
|
||||
<html>
|
||||
<style type=\"text/css\">
|
||||
body {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
#centered {
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
.label {
|
||||
text-align: left;
|
||||
}
|
||||
.text {
|
||||
width: 100%;
|
||||
}
|
||||
pre {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<head>
|
||||
<title>SMS</title>
|
||||
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
|
||||
</head>
|
||||
<body>
|
||||
"
|
||||
if [ "$REQUEST_METHOD" = POST ]; then
|
||||
read -t 3 QUERY_STRING
|
||||
eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
|
||||
action=`uhttpd -d $action 2>/dev/null`
|
||||
tel=`uhttpd -d $msisdn 2>/dev/null`
|
||||
msg=`uhttpd -d $msg 2>/dev/null`
|
||||
id=`uhttpd -d $id 2>/dev/null`
|
||||
else
|
||||
action="x"
|
||||
fi
|
||||
|
||||
case "$action" in
|
||||
send)
|
||||
echo "[global]" > /tmp/gnokiirc
|
||||
echo "model = AT" >> /tmp/gnokiirc
|
||||
echo "port = "$(uci get 3ginfo.@3ginfo[0].device) >> /tmp/gnokiirc
|
||||
echo "connection = serial" >> /tmp/gnokiirc
|
||||
|
||||
echo "$msg" | tr '+' ' ' | gnokii --config /tmp/gnokiirc --sendsms $tel 2>/dev/null
|
||||
R=$?
|
||||
if [ $R -eq 0 ]; then
|
||||
echo "Wysłano wiadomość do $tel!<br />"
|
||||
else
|
||||
echo "<font color=red><strong>Wystąpił problem z wysłaniem wiadomości!</strong></font><br />"
|
||||
fi
|
||||
echo $tel": "$msg >> /tmp/sms.txt
|
||||
rm /tmp/gnokiirc
|
||||
;;
|
||||
delete)
|
||||
echo "[global]" > /tmp/gnokiirc
|
||||
echo "model = AT" >> /tmp/gnokiirc
|
||||
echo "port = "$(uci get 3ginfo.@3ginfo[0].device) >> /tmp/gnokiirc
|
||||
echo "connection = serial" >> /tmp/gnokiirc
|
||||
gnokii --config /tmp/gnokiirc --deletesms SM $id 2>/dev/null
|
||||
rm /tmp/gnokiirc
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "
|
||||
<form method=\"post\">
|
||||
<input type=\"hidden\" name=\"action\" id=\"action\" value=\"send\">
|
||||
<div class=label>Numer telefonu:</div><input name=\"msisdn\" class=text><br />
|
||||
<div class=label>Wiadomość:</div><textarea name=\"msg\" class=text></textarea><br /><br />
|
||||
<input type=\"submit\" name=\"submit\" value=\"Wyślij\" text-align=center>
|
||||
</form>
|
||||
"
|
||||
|
||||
echo "[global]" > /tmp/gnokiirc
|
||||
echo "model = AT" >> /tmp/gnokiirc
|
||||
echo "port = "$(uci get 3ginfo.@3ginfo[0].device) >> /tmp/gnokiirc
|
||||
echo "connection = serial" >> /tmp/gnokiirc
|
||||
echo "<pre>"
|
||||
gnokii --config /tmp/gnokiirc --getsms SM 0 end 2>/dev/null | \
|
||||
sed -e ' \
|
||||
s/ (unread)/<\/pre><font color=green><strong>Nowa wiadomość<\/strong><\/font><pre>/g; \
|
||||
s/Msg Center.*//g; \
|
||||
s/(read)//g; \
|
||||
s/^Sender/Nadawca/g;s/Date\/time/Data\/czas/g; \
|
||||
s/^Text:/Treść wiadomości:<\/pre><pre style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;">/g; \
|
||||
s/\(^[0-9]*\)..Inbox Message/<\/pre><hr \/><form style="text-align: left;" method="post"><input type="hidden" name="action" id="action" value="delete"><input type="hidden" name="id" id="id" value="\1"><input type="submit" name="submit" value="Usuń"><\/form><pre>/g'
|
||||
rm /tmp/gnokiirc
|
||||
|
||||
echo "</pre>
|
||||
</div>
|
||||
</body></html>"
|
55
3ginfo/files/usr/share/3ginfo/cgi-bin/ussd.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Content-type: text/html"
|
||||
echo ""
|
||||
echo "
|
||||
<html>
|
||||
<style type=\"text/css\">
|
||||
body {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
#centered {
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
.label {
|
||||
text-align: left;
|
||||
}
|
||||
.text {
|
||||
width: 100%;
|
||||
}
|
||||
pre {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<head>
|
||||
<title>USSD</title>
|
||||
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
|
||||
</head>
|
||||
<body>
|
||||
"
|
||||
if [ "$REQUEST_METHOD" = POST ]; then
|
||||
read -t 3 QUERY_STRING
|
||||
eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
|
||||
action=`uhttpd -d $action`
|
||||
ussd=`uhttpd -d $ussd`
|
||||
else
|
||||
action="x"
|
||||
fi
|
||||
|
||||
case "$action" in
|
||||
send)
|
||||
A=$(ussd159 -p $(uci get 3ginfo.@3ginfo[0].device) -t 30 -u "$ussd")
|
||||
echo "Odpowiedź: $A<br /><br />"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "
|
||||
<form method=\"post\">
|
||||
<input type=\"hidden\" name=\"action\" id=\"action\" value=\"send\">
|
||||
<div class=label>USSD:</div><input name=\"ussd\" class=text><br />
|
||||
<input type=\"submit\" name=\"submit\" value=\"Wyślij\" text-align=center>
|
||||
</form>
|
||||
</div>
|
||||
</body></html>"
|
75
3ginfo/files/usr/share/3ginfo/index.html
Normal file
@ -0,0 +1,75 @@
|
||||
<html>
|
||||
<style type="text/css">
|
||||
body {font-family: Verdana, Arial, Helvetica, sans-serif;}
|
||||
.button {width:150px;}
|
||||
a:link {text-decoration:none;color:blue;}
|
||||
a:visited {text-decoration:none;color:blue;}
|
||||
a:active {text-decoration:none;color:blue;}
|
||||
a:hover {text-decoration:underline;color:blue;}
|
||||
.c {margin:auto;text-align:center;clear:both;}
|
||||
.l {width:39%;clear:both;float:left;text-align:right;}
|
||||
.r {width:59%;float:right; text-align:left;}
|
||||
</style>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>3G/4G</title>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function detailson() {
|
||||
document.getElementById('details').style.display = "inline";
|
||||
document.getElementById('details_on').style.display = "none";
|
||||
document.getElementById('details_off').style.display = "inline";
|
||||
}
|
||||
|
||||
function detailsoff() {
|
||||
document.getElementById('details').style.display = "none";
|
||||
document.getElementById('details_on').style.display = "inline";
|
||||
document.getElementById('details_off').style.display = "none";
|
||||
}
|
||||
|
||||
function trzyginfo(zrodlo, reload) {
|
||||
var a;
|
||||
|
||||
try {a = new XMLHttpRequest();} catch (e) {
|
||||
try {a = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {
|
||||
try {a = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {
|
||||
alert("Coś stara ta przelądarka...");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('loader').style.display = "block";
|
||||
document.getElementById('zawartosc').innerHTML = "";
|
||||
|
||||
a.open("GET", zrodlo);
|
||||
|
||||
a.onreadystatechange = function() {
|
||||
if (a.readyState == 4) {
|
||||
document.getElementById('loader').style.display = "none";
|
||||
document.getElementById('zawartosc').innerHTML = a.responseText;
|
||||
if (reload == 1) {
|
||||
location.reload(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a.send(null);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="trzyginfo('cgi-bin/3ginfo.sh',0);">
|
||||
|
||||
<table style='width:100%;height:100%;'>
|
||||
<tr><td colspan=3 style='height:100px;'> </td></tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style='width:600px; height:200px;'>
|
||||
<div id='zawartosc'></div>
|
||||
<div id='loader' style="text-align:center;display:block;"><img src="loader.gif"></div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td colspan=3> </td></tr>
|
||||
</table>
|
||||
|
||||
</body></html>
|
BIN
3ginfo/files/usr/share/3ginfo/loader.gif
Normal file
After Width: | Height: | Size: 4.1 KiB |
9
3ginfo/files/usr/share/3ginfo/scripts/cyfrowy_polsat.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
O=$(wget -q -c http://www.cyfrowypolsat.pl/internet/biezace-zuzycie/ -O -)
|
||||
O1=$(echo "$O" | sed -n '/Okres rozliczeniowy/,/_idJsp27/p' | tr -d '\n' | sed -e 's/\t//g;s/ */ /g;s/.*\(<span class="bolder">Okres.*\)\(<br><br><span\).*/\1/' | tr '\277\363\263\346\352\266\261\274\361' zolcesazn | tr '\241\306\312\243\321\323\246\257\254' ACELNOSZZ)
|
||||
if [ -z "$O1" ]; then
|
||||
echo "<div class=\"c\">Brak możliwości sprawdzenia limitu.</div>"
|
||||
else
|
||||
echo "$O1"
|
||||
fi
|
||||
|
31
3ginfo/files/usr/share/3ginfo/scripts/functions.sh
Normal file
@ -0,0 +1,31 @@
|
||||
pdu2txt() {
|
||||
# pobrany z https://forum.openwrt.org/viewtopic.php?pid=158891#p158891
|
||||
|
||||
data1=$(echo $1 | sed -e 's/.\{2\}/&\ /g')
|
||||
|
||||
ret=''
|
||||
shift=0
|
||||
carry=0
|
||||
|
||||
for byte in $data1; do
|
||||
if [ $shift -eq 7 ]; then
|
||||
ret=$ret$(echo $carry | awk '{printf("%c",$0)}')
|
||||
carry=0
|
||||
shift=0
|
||||
fi
|
||||
|
||||
byte=$((0x$byte))
|
||||
|
||||
: $(( a = (0xFF >> ($shift + 1)) & 0xFF ))
|
||||
: $(( b = $a ^ 0xFF ))
|
||||
|
||||
: $(( digit = $carry | (($byte & $a) << $shift) & 0xFF ))
|
||||
: $(( carry = ($byte & $b) >> (7 - $shift) ))
|
||||
|
||||
ret=$ret$(echo $digit | awk '{printf("%c",$0)}')
|
||||
|
||||
: $(( shift++ ))
|
||||
done
|
||||
|
||||
echo $ret
|
||||
}
|
18
3ginfo/files/usr/share/3ginfo/scripts/lycamobile_pdu.gcom
Normal file
@ -0,0 +1,18 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"AAD8EC3602\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
exit 0
|
10
3ginfo/files/usr/share/3ginfo/scripts/lycamobile_pdu.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/3ginfo/scripts/functions.sh
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/lycamobile_pdu.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
pdu2txt "$O" | tr '\n' ' ' | sed -e 's/1 Opis 9 Powrot 0 Wyjscie//g'
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
71
3ginfo/files/usr/share/3ginfo/scripts/mbank.gcom
Normal file
@ -0,0 +1,71 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CNMI=0,1,0,0,0^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CMGF=1^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CMGL=\"ALL\"^m"
|
||||
waitfor 10 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CUSD=1,\"*121#\",15^m"
|
||||
waitfor 5 "+CUSD:"
|
||||
if % = -1 goto error
|
||||
|
||||
let $c="AT+CMGL=\"REC UNREAD\"^m"
|
||||
let $r="+CMGL"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CMGL=\"REC UNREAD\"^m"
|
||||
let $r="+CMGL"
|
||||
gosub readatcmd
|
||||
|
||||
:error
|
||||
print "Problem operatora - brak możliwości sprawdzenia..."
|
||||
exit 0
|
||||
|
||||
:readatcmd
|
||||
let i=20
|
||||
send $c
|
||||
:loop
|
||||
get 1 "^m" $s
|
||||
let l=len($r)
|
||||
if len($s) < l goto loop1
|
||||
if $mid($s,1,l) <> $r goto loop1
|
||||
|
||||
let $j="x"
|
||||
if $mid($s,9,1) <> "," goto del2
|
||||
let $j=$mid($s,8,1)
|
||||
goto del3
|
||||
:del2
|
||||
if $mid($s,10,1) <> "," goto del3
|
||||
let $j=$mid($s,8,2)
|
||||
|
||||
:del3
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
if $j = "x" goto del4
|
||||
send "AT+CMGD="
|
||||
send $j
|
||||
send "^m"
|
||||
waitfor 5 "OK"
|
||||
:del4
|
||||
exit 0
|
||||
|
||||
:loop1
|
||||
if len($s) < 2 goto loop2
|
||||
if $mid($s,1,2) = "ER" return
|
||||
:loop2
|
||||
if i = 0 return
|
||||
let i=i-1
|
||||
sleep 0.5
|
||||
goto loop
|
71
3ginfo/files/usr/share/3ginfo/scripts/mbank_pdu.gcom
Normal file
@ -0,0 +1,71 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CNMI=0,1,0,0,0^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CMGF=1^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CMGL=\"ALL\"^m"
|
||||
waitfor 10 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CUSD=1,\"AA982C3602\",15^m"
|
||||
waitfor 5 "+CUSD:"
|
||||
if % = -1 goto error
|
||||
|
||||
let $c="AT+CMGL=\"REC UNREAD\"^m"
|
||||
let $r="+CMGL"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CMGL=\"REC UNREAD\"^m"
|
||||
let $r="+CMGL"
|
||||
gosub readatcmd
|
||||
|
||||
:error
|
||||
print "Problem operatora - brak możliwości sprawdzenia..."
|
||||
exit 0
|
||||
|
||||
:readatcmd
|
||||
let i=20
|
||||
send $c
|
||||
:loop
|
||||
get 1 "^m" $s
|
||||
let l=len($r)
|
||||
if len($s) < l goto loop1
|
||||
if $mid($s,1,l) <> $r goto loop1
|
||||
|
||||
let $j="x"
|
||||
if $mid($s,9,1) <> "," goto del2
|
||||
let $j=$mid($s,8,1)
|
||||
goto del3
|
||||
:del2
|
||||
if $mid($s,10,1) <> "," goto del3
|
||||
let $j=$mid($s,8,2)
|
||||
|
||||
:del3
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
if $j = "x" goto del4
|
||||
send "AT+CMGD="
|
||||
send $j
|
||||
send "^m"
|
||||
waitfor 5 "OK"
|
||||
:del4
|
||||
exit 0
|
||||
|
||||
:loop1
|
||||
if len($s) < 2 goto loop2
|
||||
if $mid($s,1,2) = "ER" return
|
||||
:loop2
|
||||
if i = 0 return
|
||||
let i=i-1
|
||||
sleep 0.5
|
||||
goto loop
|
27
3ginfo/files/usr/share/3ginfo/scripts/ofnk.gcom
Normal file
@ -0,0 +1,27 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "at+cmgf=0^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "at+cscs=\"IRA\"^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CUSD=1,\"AA182CA682C546\",15^m"
|
||||
waitfor 5 "+CUSD:"
|
||||
if % = -1 goto error
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
exit 0
|
||||
|
||||
:error
|
||||
print ""
|
||||
|
||||
exit 0
|
10
3ginfo/files/usr/share/3ginfo/scripts/ofnk.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/3ginfo/scripts/functions.sh
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/ofnk.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
pdu2txt "$O"
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
19
3ginfo/files/usr/share/3ginfo/scripts/ofnk2.gcom
Normal file
@ -0,0 +1,19 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"*101*01#\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
|
||||
exit 0
|
9
3ginfo/files/usr/share/3ginfo/scripts/ofnk2.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/ofnk2.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
A=$(echo $O | awk '{for(i=1;;i=i+4)if(substr($1,i,4)!=""){printf "%c",(index("0123456789ABCDEF",substr($1,i+2,1))-1)*16+(index("0123456789ABCDEF",substr($1,i+3,1))-1)}else exit;}')
|
||||
echo $A | sed -e 's/1 Opis.*9 Powrot.*0 Wyjscie//g'
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
37
3ginfo/files/usr/share/3ginfo/scripts/play_fresh.gcom
Normal file
@ -0,0 +1,37 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"*111#\",15^m"
|
||||
waitfor 10 "0 Wyjscie"
|
||||
if % = -1 goto noresponse
|
||||
|
||||
send "AT+CUSD=1,\"1\",15^m"
|
||||
waitfor 10 "0 Wyjscie"
|
||||
if % = -1 goto noresponse
|
||||
|
||||
let c=20
|
||||
send "AT+CUSD=1,\"3\",15^m"
|
||||
:loop
|
||||
get 1 "^m" $s
|
||||
if c=0 goto exit
|
||||
if len($s) < 6 goto toshort
|
||||
if $mid($s,1,5) = "+CUSD" goto ok
|
||||
:toshort
|
||||
let c=c-1
|
||||
sleep 1
|
||||
goto loop
|
||||
:ok
|
||||
let $s=$right($s,len($s)-10)
|
||||
print $s,"\"\n"
|
||||
|
||||
:exit
|
||||
send "AT+CUSD=1,\"0\",15^m"
|
||||
waitfor 10 "Dziekujemy"
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print "Problem operatora - brak możliwości sprawdzenia..."
|
||||
exit 0
|
28
3ginfo/files/usr/share/3ginfo/scripts/play_fresh2.gcom
Normal file
@ -0,0 +1,28 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"*111#\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
send "AT+CUSD=1,\"1\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
send "AT+CUSD=1,\"3\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
send "AT+CUSD=1,\"0\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
exit 0
|
9
3ginfo/files/usr/share/3ginfo/scripts/play_fresh2.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/play_fresh2.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
A=$(echo $O | awk '{for(i=1;;i=i+4)if(substr($1,i,4)!=""){printf "%c",(index("0123456789ABCDEF",substr($1,i+2,1))-1)*16+(index("0123456789ABCDEF",substr($1,i+3,1))-1)}else exit;}')
|
||||
echo $A | sed -e 's/1 Opis.*9 Powrot.*0 Wyjscie//g'
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
28
3ginfo/files/usr/share/3ginfo/scripts/play_fresh_pdu.gcom
Normal file
@ -0,0 +1,28 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"AA582C3602\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
send "AT+CUSD=1,\"31\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
send "AT+CUSD=1,\"33\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
send "AT+CUSD=1,\"30\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
exit 0
|
10
3ginfo/files/usr/share/3ginfo/scripts/play_fresh_pdu.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/3ginfo/scripts/functions.sh
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/play_fresh_pdu.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
pdu2txt "$O" | tr '\n' ' ' | sed -e 's/1 Opis.*9 Powrot.*0 Wyjscie//g'
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
20
3ginfo/files/usr/share/3ginfo/scripts/tmobile_pdu.gcom
Normal file
@ -0,0 +1,20 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"AA182C3602\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
send "AT+CUSD=1,\"30\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
exit 0
|
10
3ginfo/files/usr/share/3ginfo/scripts/tmobile_pdu.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/3ginfo/scripts/functions.sh
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/tmobile.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
pdu2txt "$O" | tr '\n' ' ' | sed -e 's/1 Opis 9 Powrot 0 Wyjscie//g'
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
19
3ginfo/files/usr/share/3ginfo/scripts/virginmobile.gcom
Normal file
@ -0,0 +1,19 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "AT+CUSD=1,\"*108#\",15^m"
|
||||
waitfor 10 "+CUSD: "
|
||||
if % = -1 goto noresponse
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
exit 0
|
||||
|
||||
:noresponse
|
||||
print ""
|
||||
|
||||
exit 0
|
27
3ginfo/files/usr/share/3ginfo/scripts/virginmobile_pdu.gcom
Normal file
@ -0,0 +1,27 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.02
|
||||
waitquiet 0.2 0.2
|
||||
|
||||
send "at+cmgf=0^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "at+cscs=\"IRA\"^m"
|
||||
waitfor 5 "OK"
|
||||
if % = -1 goto error
|
||||
|
||||
send "AT+CUSD=1,\"AA180C3702\",15^m"
|
||||
waitfor 5 "+CUSD:"
|
||||
if % = -1 goto error
|
||||
|
||||
get 1 "^m" $s
|
||||
print $s
|
||||
|
||||
exit 0
|
||||
|
||||
:error
|
||||
print ""
|
||||
|
||||
exit 0
|
10
3ginfo/files/usr/share/3ginfo/scripts/virginmobile_pdu.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
. /usr/share/3ginfo/scripts/functions.sh
|
||||
|
||||
DEVICE=$(uci -q get 3ginfo.@3ginfo[0].device)
|
||||
O=$(gcom -d $DEVICE -s /usr/share/3ginfo/scripts/virginmobile_pdu.gcom | cut -f2 -d\")
|
||||
if [ ! -z "$O" ]; then
|
||||
pdu2txt "$O"
|
||||
else
|
||||
echo "Problem operatora - brak możliwości sprawdzenia"
|
||||
fi
|
86
3ginfo/files/usr/share/3ginfo/signal.html
Normal file
@ -0,0 +1,86 @@
|
||||
<html>
|
||||
<style type="text/css">
|
||||
body {font-family: Verdana, Arial, Helvetica, sans-serif;}
|
||||
.c {margin:auto;text-align:center;clear:both;}
|
||||
.l {width:49%;clear:both;float:left;text-align:right;}
|
||||
.r {width:49%;float:right;text-align:left;}
|
||||
</style>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Siła sygnału</title>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
var secs=0;
|
||||
var delay = 1000;
|
||||
|
||||
startTimer();
|
||||
function startTimer()
|
||||
{
|
||||
if (secs==0)
|
||||
{
|
||||
secs=3;
|
||||
refreshData();
|
||||
}
|
||||
else
|
||||
{
|
||||
self.status = secs;
|
||||
secs = secs - 1;
|
||||
}
|
||||
self.setTimeout("startTimer()", delay);
|
||||
}
|
||||
function refreshData()
|
||||
{
|
||||
var req;
|
||||
|
||||
try {req = new XMLHttpRequest();} catch (e) {
|
||||
try {req = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {
|
||||
try {req = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {
|
||||
alert("Coś stara ta przelądarka...");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
req.open("GET", "/cgi-bin/signal.sh");
|
||||
|
||||
req.onreadystatechange = function() {
|
||||
|
||||
if (req.readyState == 4) {
|
||||
var line=req.responseText;
|
||||
var arr=(line.split(/,/));
|
||||
if(arr.length>3)
|
||||
{
|
||||
var p = (arr[2]*100/31).toFixed();
|
||||
document.getElementById('csq').innerHTML=p+'%';
|
||||
document.getElementById('precent').style.width=p+"%";
|
||||
var color = "red";
|
||||
if (p > 29) {color="orange"; }
|
||||
if (p > 45) {color="yellow"; }
|
||||
if (p > 61) {color="green"; }
|
||||
document.getElementById('precent').style.backgroundColor=color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
req.send(null);
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table style='width:100%;height:100%;'>
|
||||
<tr><td colspan=3 style='height:100px;'> </td></tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style='width:600px; height:200px;'>
|
||||
<span class="l">Siła sygnału:</span><span id="csq" class="r"></span>
|
||||
<div style="float:left; margin:1%; width:98%; height:20px; border:1px solid #000000; background-color:transparent;">
|
||||
<div id="precent" style="float:left; background-color:black; border-right:1px solid #000000; height:100%; width:0%"> </div>
|
||||
</div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td colspan=3> </td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
35
3ginfo/files/usr/share/3ginfo/status.html.en
Normal file
@ -0,0 +1,35 @@
|
||||
<span class="l" style="display:{STATUS_SHOW}">Status:</span><span class="r" style="display:{STATUS_SHOW}">{STATUS}</span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Connection time:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{CONN_TIME}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Received:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{RX}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Transmitted:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{TX}</small></span>
|
||||
<span class="l">Operator:</span><span class="r">{COPS}</span>
|
||||
<span class="l">Operating mode:</span><span class="r">{MODE}</span>
|
||||
<span class="l">Signal strength:</span><span class="r"><strong>{CSQ_PER}%</strong></span>
|
||||
<div style="float:left; margin:1%; width:98%; height:20px; border:1px solid #000000; background-color:transparent;">
|
||||
<div style="float:left; background-color:{CSQ_COL}; border-right:1px solid #000000; height:100%; width:{CSQ_PER}%"> </div>
|
||||
</div>
|
||||
<div class="c" style="display:{SMS_SHOW};"><input type="button" class="button" value="SMS" onClick="window.location.href='cgi-bin/sms.sh'"></div>
|
||||
<div class="c" style="display:{USSD_SHOW};"><input type="button" class="button" value="USSD" onClick="window.location.href='cgi-bin/ussd.sh'"></div>
|
||||
<div class="c" style="display:{LIMIT_SHOW};"><input type="button" class="button" value="Pozostały limit" onClick="return trzyginfo('cgi-bin/limit.sh',0);"></div>
|
||||
<div class="c"><input type="button" class="button" value="Refresh" onClick="return trzyginfo('cgi-bin/3ginfo.sh',0);"></div>
|
||||
<div class="c" style="display:{STATUS_SHOW_BUTTON}"><input type="button" class="button" value="{STATUS_TRE}" onClick="trzyginfo('cgi-bin/onoff.sh',1);"></div>
|
||||
<br />
|
||||
<a href="#" id='details_on' onclick="detailson();" style="float:left;display:inline;"><small>Show details</small></a>
|
||||
<a href="#" id='details_off' onclick="detailsoff();" style="float:left;display:none;"><small>Hide details</small></a>
|
||||
<br />
|
||||
<div id='details' style="display:none;">
|
||||
<span class="l">CSQ:</span><span class="r">{CSQ}</span>
|
||||
<span class="l">RSSI:</span><span class="r">{CSQ_RSSI} dBm</span>
|
||||
<span class="l" style="display:{QOS_SHOW}">UMTS QoS Profile:</span><span class="r" style="display:{QOS_SHOW}">{DOWN} kbps DOWN | {UP} kbps UP</span>
|
||||
<span class="l">MCC MNC:</span><span class="r">{COPS_MCC} {COPS_MNC}</span>
|
||||
<span class="l">LAC:</span><span class="r">{LAC} ({LAC_NUM})</span>
|
||||
<span class="l">CID:</span><span class="r">{CID} ({CID_NUM})</span>
|
||||
<span class="l">TAC:</span><span class="r">{TAC} ({TAC_NUM})</span>
|
||||
<span class="l">RSCP:</span><span class="r">{RSCP} dBm</span>
|
||||
<span class="l">Ec/IO:</span><span class="r">{ECIO} dB</span>
|
||||
<span class="l">RSRP:</span><span class="r">{RSRP} dBm</span>
|
||||
<span class="l">SINR:</span><span class="r">{SINR} dB</span>
|
||||
<span class="l">RSRQ:</span><span class="r">{RSRQ} dB</span>
|
||||
<span class="l"> </span><small><span class="r">{BTSINFO}</small>
|
||||
<span class="l">Device:</span><span class="r">{DEVICE}</span>
|
||||
</div>
|
35
3ginfo/files/usr/share/3ginfo/status.html.it
Normal file
@ -0,0 +1,35 @@
|
||||
<span class="l" style="display:{STATUS_SHOW}">Stato:</span><span class="r" style="display:{STATUS_SHOW}">{STATUS}</span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Tempo di connessione:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{CONN_TIME}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Ricevuti:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{RX}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Trasmessi:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{TX}</small></span>
|
||||
<span class="l">Operatore:</span><span class="r">{COPS}</span>
|
||||
<span class="l">Tipo di connessione:</span><span class="r">{MODE}</span>
|
||||
<span class="l">Forza segnale:</span><span class="r"><strong>{CSQ_PER}%</strong></span>
|
||||
<div style="float:left; margin:1%; width:98%; height:20px; border:1px solid #000000; background-color:transparent;">
|
||||
<div style="float:left; background-color:{CSQ_COL}; border-right:1px solid #000000; height:100%; width:{CSQ_PER}%"> </div>
|
||||
</div>
|
||||
<div class="c" style="display:{SMS_SHOW};"><input type="button" class="button" value="SMS" onClick="window.location.href='cgi-bin/sms.sh'"></div>
|
||||
<div class="c" style="display:{USSD_SHOW};"><input type="button" class="button" value="USSD" onClick="window.location.href='cgi-bin/ussd.sh'"></div>
|
||||
<div class="c" style="display:{LIMIT_SHOW};"><input type="button" class="button" value="Limite" onClick="return trzyginfo('cgi-bin/limit.sh',0);"></div>
|
||||
<div class="c"><input type="button" class="button" value="Aggiorna" onClick="return trzyginfo('cgi-bin/3ginfo.sh',0);"></div>
|
||||
<div class="c" style="display:{STATUS_SHOW_BUTTON}"><input type="button" class="button" value="{STATUS_TRE}" onClick="trzyginfo('cgi-bin/onoff.sh',1);"></div>
|
||||
<br />
|
||||
<a href="#" id='details_on' onclick="detailson();" style="float:left;display:inline;"><small>Mostra dettagli</small></a>
|
||||
<a href="#" id='details_off' onclick="detailsoff();" style="float:left;display:none;"><small>Nascondi dettagli</small></a>
|
||||
<br />
|
||||
<div id='details' style="display:none;">
|
||||
<span class="l">CSQ:</span><span class="r">{CSQ}</span>
|
||||
<span class="l">RSSI:</span><span class="r">{CSQ_RSSI} dBm</span>
|
||||
<span class="l" style="display:{QOS_SHOW}">Profilo UMTS QoS:</span><span class="r" style="display:{QOS_SHOW}">{DOWN} kbps DOWN | {UP} kbps UP</span>
|
||||
<span class="l">MCC MNC:</span><span class="r">{COPS_MCC} {COPS_MNC}</span>
|
||||
<span class="l">LAC:</span><span class="r">{LAC} ({LAC_NUM})</span>
|
||||
<span class="l">CID:</span><span class="r">{CID} ({CID_NUM})</span>
|
||||
<span class="l">TAC:</span><span class="r">{TAC} ({TAC_NUM})</span>
|
||||
<span class="l">RSCP:</span><span class="r">{RSCP} dBm</span>
|
||||
<span class="l">Ec/IO:</span><span class="r">{ECIO} dB</span>
|
||||
<span class="l">RSRP:</span><span class="r">{RSRP} dBm</span>
|
||||
<span class="l">SINR:</span><span class="r">{SINR} dB</span>
|
||||
<span class="l">RSRQ:</span><span class="r">{RSRQ} dB</span>
|
||||
<span class="l"> </span><small><span class="r">{BTSINFO}</small>
|
||||
<span class="l">Dispositivo:</span><span class="r">{DEVICE}</span>
|
||||
</div>
|
35
3ginfo/files/usr/share/3ginfo/status.html.pl
Normal file
@ -0,0 +1,35 @@
|
||||
<span class="l" style="display:{STATUS_SHOW}">Status:</span><span class="r" style="display:{STATUS_SHOW}">{STATUS}</span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Czas połączenia:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{CONN_TIME}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Pobrano:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{RX}</small></span>
|
||||
<span class="l" style="display:{STATUS_SHOW}"><small>Wysłano:</small></span><span class="r" style="display:{STATUS_SHOW}"><small>{TX}</small></span>
|
||||
<span class="l">Operator:</span><span class="r">{COPS}</span>
|
||||
<span class="l">Tryb pracy:</span><span class="r">{MODE}</span>
|
||||
<span class="l">Siła sygnału:</span><span class="r"><strong>{CSQ_PER}%</strong></span>
|
||||
<div style="float:left; margin:1%; width:98%; height:20px; border:1px solid #000000; background-color:transparent;">
|
||||
<div style="float:left; background-color:{CSQ_COL}; border-right:1px solid #000000; height:100%; width:{CSQ_PER}%"> </div>
|
||||
</div>
|
||||
<div class="c" style="display:{SMS_SHOW};"><input type="button" class="button" value="SMS" onClick="window.location.href='cgi-bin/sms.sh'"></div>
|
||||
<div class="c" style="display:{USSD_SHOW};"><input type="button" class="button" value="USSD" onClick="window.location.href='cgi-bin/ussd.sh'"></div>
|
||||
<div class="c" style="display:{LIMIT_SHOW};"><input type="button" class="button" value="Pozostały limit" onClick="return trzyginfo('cgi-bin/limit.sh',0);"></div>
|
||||
<div class="c"><input type="button" class="button" value="Odśwież" onClick="return trzyginfo('cgi-bin/3ginfo.sh',0);"></div>
|
||||
<div class="c" style="display:{STATUS_SHOW_BUTTON}"><input type="button" class="button" value="{STATUS_TRE}" onClick="trzyginfo('cgi-bin/onoff.sh',1);"></div>
|
||||
<br />
|
||||
<a href="#" id='details_on' onclick="detailson();" style="float:left;display:inline;"><small>Pokaż informacje dodatkowe</small></a>
|
||||
<a href="#" id='details_off' onclick="detailsoff();" style="float:left;display:none;"><small>Ukryj informacje dodatkowe</small></a>
|
||||
<br />
|
||||
<div id='details' style="display:none;">
|
||||
<span class="l">CSQ:</span><span class="r">{CSQ}</span>
|
||||
<span class="l">RSSI:</span><span class="r">{CSQ_RSSI} dBm</span>
|
||||
<span class="l" style="display:{QOS_SHOW}">Profil UMTS QoS:</span><span class="r" style="display:{QOS_SHOW}">{DOWN} kbps DOWN | {UP} kbps UP</span>
|
||||
<span class="l">MCC MNC:</span><span class="r">{COPS_MCC} {COPS_MNC}</span>
|
||||
<span class="l">LAC:</span><span class="r">{LAC} ({LAC_NUM})</span>
|
||||
<span class="l">CID:</span><span class="r">{CID} ({CID_NUM})</span>
|
||||
<span class="l">TAC:</span><span class="r">{TAC} ({TAC_NUM})</span>
|
||||
<span class="l">RSCP:</span><span class="r">{RSCP} dBm</span>
|
||||
<span class="l">Ec/IO:</span><span class="r">{ECIO} dB</span>
|
||||
<span class="l">RSRP:</span><span class="r">{RSRP} dBm</span>
|
||||
<span class="l">SINR:</span><span class="r">{SINR} dB</span>
|
||||
<span class="l">RSRQ:</span><span class="r">{RSRQ} dB</span>
|
||||
<span class="l"> </span><small><span class="r">{BTSINFO}</small>
|
||||
<span class="l">Urządzenie:</span><span class="r">{DEVICE}</span>
|
||||
</div>
|
1
3ginfo/files/usr/share/3ginfo/uhttpd.conf
Normal file
@ -0,0 +1 @@
|
||||
E404:/index.html
|
94
3proxy/Makefile
Executable file
@ -0,0 +1,94 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=3proxy
|
||||
PKG_VERSION:=0.9.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=muziling <lls924@gmail.com>
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/z3APA3A/3proxy.git
|
||||
PKG_SOURCE_VERSION:=5165a4d5bd894826f5f6f4ac0dc70902f46d29e7
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=3proxy OpenWRT package
|
||||
DEPENDS:=+libpthread +libopenssl
|
||||
endef
|
||||
|
||||
define Package/lib$(PKG_NAME)
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=+3proxy
|
||||
TITLE:=3proxy libraries
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-common
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=+3proxy
|
||||
TITLE:=3proxy addional servers
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-sql
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+3proxy
|
||||
TITLE:=3proxy sql template
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
3APA3A 3proxy tiny proxy servers
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(CP) $(PKG_BUILD_DIR)/Makefile.Linux $(PKG_BUILD_DIR)/Makefile
|
||||
endef
|
||||
|
||||
define Package.$(PKG_NAME)/conffiles
|
||||
/etc/config/3proxy
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/3proxy \
|
||||
$(PKG_BUILD_DIR)/bin/proxy \
|
||||
$(1)/usr/bin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/lib$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/3proxy
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/*.so $(1)/usr/lib/3proxy
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-common/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/ftppr \
|
||||
$(PKG_BUILD_DIR)/bin/mycrypt \
|
||||
$(PKG_BUILD_DIR)/bin/pop3p \
|
||||
$(PKG_BUILD_DIR)/bin/smtpp \
|
||||
$(PKG_BUILD_DIR)/bin/tcppm \
|
||||
$(PKG_BUILD_DIR)/bin/udppm \
|
||||
$(PKG_BUILD_DIR)/bin/socks \
|
||||
$(1)/usr/bin
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-sql/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/3proxy
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/cfg/sql/* $(1)/usr/share/3proxy
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,lib$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-common))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-sql))
|
||||
|
17
3proxy/README.md
Executable file
@ -0,0 +1,17 @@
|
||||
3proxy running on Openwrt/LEDE
|
||||
===
|
||||
|
||||
编译/Compile
|
||||
---
|
||||
|
||||
```bash
|
||||
cd openwrt
|
||||
git clone https://github.com/muziling/3proxy-openwrt.git feeds/packages/net/3proxy
|
||||
rm -rf tmp/
|
||||
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
make menuconfig
|
||||
make package/3proxy/compile
|
||||
```
|
3
3proxy/files/etc/3proxy.cfg
Executable file
@ -0,0 +1,3 @@
|
||||
daemon
|
||||
auth strong
|
||||
proxy -p3128
|
2
3proxy/files/etc/config/3proxy
Executable file
@ -0,0 +1,2 @@
|
||||
config 3proxy
|
||||
option config '/etc/3proxy.cfg'
|
17
3proxy/files/etc/init.d/3proxy
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# init script 3proxy for openwrt
|
||||
# written by Konstantin Shevlakov <shevlakov@132lan.ru>
|
||||
|
||||
START=99
|
||||
|
||||
start(){
|
||||
CONFIG_PROXY=$(uci -q get 3proxy.@3proxy[0].config)
|
||||
if [ -n $CONFIG_PROXY ]; then
|
||||
/usr/bin/3proxy $CONFIG_PROXY
|
||||
fi
|
||||
}
|
||||
|
||||
stop(){
|
||||
killall 3proxy
|
||||
}
|
30
3proxy/patches/0001-Makefile-fix.patch
Normal file
@ -0,0 +1,30 @@
|
||||
Index: 3proxy/Makefile.Linux
|
||||
===================================================================
|
||||
--- 3proxy.orig/Makefile.Linux
|
||||
+++ 3proxy/Makefile.Linux
|
||||
@@ -8,13 +8,13 @@
|
||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||
|
||||
BUILDDIR = ../bin/
|
||||
-CC = gcc
|
||||
|
||||
-CFLAGS = -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
|
||||
+
|
||||
+CFLAGS = -fPIC -fno-strict-aliasing -c -pthread -DWITHSPLICE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
|
||||
COUT = -o
|
||||
LN = $(CC)
|
||||
DCFLAGS =
|
||||
-LDFLAGS = -fPIE -O2 -fno-strict-aliasing -pthread
|
||||
+LDFLAGS = -fno-strict-aliasing
|
||||
DLFLAGS = -shared
|
||||
DLSUFFICS = .ld.so
|
||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||
@@ -33,7 +33,7 @@ MAKEFILE = Makefile.Linux
|
||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
||||
# SSLPlugin requires -lcrypto -lssl
|
||||
#LIBS = -lcrypto -lssl -ldl
|
||||
-LIBS = -ldl
|
||||
+LIBS = -lcrypto -lssl -ldl -pthread
|
||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
|
15
3proxy/patches/0002-fix-loff_t.patch
Executable file
@ -0,0 +1,15 @@
|
||||
--- a/src/sockmap.c 2018-07-03 21:56:33.000000000 +0000
|
||||
+++ b/src/sockmap.c 2018-08-13 13:28:22.584777087 +0000
|
||||
@@ -8,10 +8,11 @@
|
||||
|
||||
#include "proxy.h"
|
||||
|
||||
+#define _FILE_OFFSET_BITS 64
|
||||
#ifdef WITHSPLICE
|
||||
|
||||
#include <fcntl.h>
|
||||
-ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);
|
||||
+ssize_t splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags);
|
||||
#ifndef SPLICE_F_MOVE
|
||||
#define SPLICE_F_MOVE 0x01
|
||||
#endif
|
13
3proxy/patches/0003-enable-ssl_plugin.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: 3proxy/Makefile.Linux
|
||||
===================================================================
|
||||
--- 3proxy.orig/Makefile.Linux
|
||||
+++ 3proxy/Makefile.Linux
|
||||
@@ -35,7 +35,7 @@ MAKEFILE = Makefile.Linux
|
||||
#LIBS = -lcrypto -lssl -ldl
|
||||
LIBS = -lcrypto -lssl -ldl -pthread
|
||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||
-PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
+PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||
|
||||
include Makefile.inc
|
||||
|
18
3proxy/patches/0004-version.patch
Normal file
@ -0,0 +1,18 @@
|
||||
--- a/src/version.h
|
||||
+++ b/src/version.h
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef VERSION
|
||||
-#define VERSION "3proxy-0.9.3"
|
||||
+#define VERSION "3proxy-0.9.4"
|
||||
#endif
|
||||
#ifndef BUILDDATE
|
||||
#define BUILDDATE ""
|
||||
#endif
|
||||
#define MAJOR3PROXY 0
|
||||
#define SUBMAJOR3PROXY 9
|
||||
-#define MINOR3PROXY 3
|
||||
+#define MINOR3PROXY 4
|
||||
#define SUBMINOR3PROXY 0
|
||||
-#define RELEASE3PROXY "3proxy-0.9.3(" BUILDDATE ")\0"
|
||||
+#define RELEASE3PROXY "3proxy-0.9.4(" BUILDDATE ")\0"
|
||||
#define YEAR3PROXY "2021"
|
96
asterisk-chan-quectel/Makefile
Normal file
@ -0,0 +1,96 @@
|
||||
#
|
||||
# Copyright (C) 2017 - 2018 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=asterisk-chan-quectel
|
||||
PKG_VERSION:=3.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=907760db982c19817c87d38215b8731db3e7aa16
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt
|
||||
PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
|
||||
|
||||
define Build/Prepare
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
|
||||
|
||||
MODULES_DIR:=/usr/lib/asterisk/modules
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
# asterisk-chan-quectel needs iconv
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/asterisk-chan-quectel/Default
|
||||
SUBMENU:=Telephony
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel
|
||||
DEPENDS:=asterisk $(ICONV_DEPENDS) +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +alsa-lib
|
||||
TITLE:=Asterisk Mobile Telephony Module
|
||||
endef
|
||||
|
||||
define Package/asterisk16-chan-quectel
|
||||
$(call Package/asterisk-chan-quectel/Default)
|
||||
DEPENDS+=asterisk16
|
||||
VARIANT:=asterisk16
|
||||
endef
|
||||
|
||||
define Package/description/Default
|
||||
Asterisk channel driver for mobile telephony.
|
||||
endef
|
||||
|
||||
Package/asterisk16-chan-quectel/description = $(Package/description/Default)
|
||||
|
||||
ifeq ($(BUILD_VARIANT),asterisk16)
|
||||
CHAN_quectel_AST_HEADERS:=$(STAGING_DIR)/usr/include/asterisk-16/include
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-astversion=16
|
||||
endif
|
||||
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-asterisk=$(CHAN_quectel_AST_HEADERS)
|
||||
|
||||
TARGET_CFLAGS+= \
|
||||
-I$(CHAN_quectel_AST_HEADERS)
|
||||
|
||||
MAKE_FLAGS+=LD="$(TARGET_CC)"
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
DESTDIR="$(MODULES_DIR)" \
|
||||
ac_cv_type_size_t=yes \
|
||||
ac_cv_type_ssize_t=yes
|
||||
|
||||
|
||||
define Package/conffiles/Default
|
||||
/etc/asterisk/quectel.conf
|
||||
endef
|
||||
|
||||
Package/asterisk16-chan-quectel/conffiles = $(Package/conffiles/Default)
|
||||
|
||||
define Package/Install/Default
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/quectel.conf $(1)/etc/asterisk
|
||||
$(INSTALL_DIR) $(1)$(MODULES_DIR)
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_quectel.so $(1)$(MODULES_DIR)
|
||||
endef
|
||||
|
||||
Package/asterisk16-chan-quectel/install = $(Package/Install/Default)
|
||||
|
||||
$(eval $(call BuildPackage,asterisk16-chan-quectel))
|
@ -0,0 +1,34 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -83,8 +83,8 @@ fi
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl AC_CHECK_LIB([pthread], [pthread_create]) # should use ast_pthread_join everywhere?
|
||||
-AC_SEARCH_LIBS([iconv], [c iconv],,AC_MSG_ERROR([iconv library missing]))
|
||||
-AC_CHECK_LIB([sqlite3], [sqlite3_open],,AC_MSG_ERROR([sqlite3 library missing]))
|
||||
+dnl AC_SEARCH_LIBS([iconv], [c iconv],,AC_MSG_ERROR([iconv library missing]))
|
||||
+AC_CHECK_LIB([iconv], [libiconv])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h termios.h])
|
||||
@@ -108,9 +108,8 @@ AC_DEFUN([AC_HEADER_FIND], [
|
||||
]
|
||||
)
|
||||
|
||||
-AC_HEADER_FIND([asterisk.h], $with_asterisk)
|
||||
-AC_HEADER_FIND([iconv.h], $with_iconv)
|
||||
-AC_CHECK_HEADER([sqlite3.h],,AC_MSG_ERROR([sqlite3.h header file missing]))
|
||||
+dnl AC_HEADER_FIND([iconv.h], $with_iconv)
|
||||
+dnl AC_CHECK_HEADER([sqlite3.h],,AC_MSG_ERROR([sqlite3.h header file missing]))
|
||||
|
||||
AC_DEFINE([ICONV_CONST],[], [Define to const if you has iconv() const declaration of input buffer])
|
||||
AC_MSG_CHECKING([for iconv use const inbuf])
|
||||
@@ -224,8 +223,6 @@ dnl Apply options to defines
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
CFLAGS="$CFLAGS -O0 -g"
|
||||
AC_DEFINE([__DEBUG__], [1], [Build with debugging])
|
||||
-else
|
||||
- CFLAGS="$CFLAGS -O6"
|
||||
fi
|
||||
|
||||
dnl Asterisk header files use lots of old style declarations, ignore those.
|
57
atinout/Makefile
Normal file
@ -0,0 +1,57 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=atinout
|
||||
PKG_VERSION=0.9.1
|
||||
|
||||
PKG_MAINTAINER:=Konstantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/beralt/atinout.git
|
||||
PKG_SOURCE_VERSION:=4013e8db4cd140c1df24bb90f929efeb9b61b238
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Telephony
|
||||
TITLE:=Send AT commands to a modem
|
||||
URL:=http://atinout.sourceforge.net/
|
||||
MAINTAINER:=Adrian Guenter <a@gntr.me>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Atinout is a program that will execute AT commands in sequence and
|
||||
capture the response from the modem.
|
||||
endef
|
||||
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CC) +.c++" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -DVERSION=\"\\\"$(PKG_VERSION)\\\"\"" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo -e "\n=== Build/Compile ==="
|
||||
$(CONFIGURE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
all \
|
||||
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
39
cellled/Makefile
Normal file
@ -0,0 +1,39 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cellled
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=Konstantine Shevlakov <shevlakov@132lan.ru>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
PKGARCH:=all
|
||||
TITLE:=LED cellular signal signal strength
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Indicate LED cellular signal signal strength.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/cellled
|
||||
endef
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) ./root/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
25
cellled/root/etc/config/cellled
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
config device
|
||||
option data_type 'qmi'
|
||||
option device_qmi '/dev/cdc-wdm0'
|
||||
option timeout '5'
|
||||
|
||||
config rssi_led
|
||||
option led 'blue:sys'
|
||||
option rssi_min '20'
|
||||
option rssi_max '39'
|
||||
|
||||
config rssi_led
|
||||
option led 'blue:wlan0'
|
||||
option rssi_min '40'
|
||||
option rssi_max '59'
|
||||
|
||||
config rssi_led
|
||||
option led 'blue:wlan1'
|
||||
option rssi_min '60'
|
||||
option rssi_max '79'
|
||||
|
||||
config rssi_led
|
||||
option led 'blue:net'
|
||||
option rssi_min '80'
|
||||
option rssi_max '100'
|
32
cellled/root/etc/init.d/cellled
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
|
||||
START=99
|
||||
|
||||
start() {
|
||||
if [ ! -f "/var/run/cellled.pid" ]; then
|
||||
/usr/bin/cellled >/dev/null 2>&1 &
|
||||
PID=$(pgrep -f /usr/bin/cellled)
|
||||
if [ $PID ]; then
|
||||
echo $PID > /var/run/cellled.pid
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
stop() {
|
||||
rm -f /var/run/cellled.pid
|
||||
kill $(pgrep -f /usr/bin/cellled) >/dev/null 2>&1
|
||||
/etc/init.d/led start
|
||||
}
|
||||
|
||||
restart(){
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
boot() {
|
||||
(sleep 5 && start >/dev/null 2>&1) &
|
||||
return 0
|
||||
}
|
4
cellled/root/usr/bin/cellled
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
while true :; do
|
||||
/usr/share/cellled.sh >/dev/null 2>&1
|
||||
done
|
174
cellled/root/usr/share/cellled.sh
Executable file
@ -0,0 +1,174 @@
|
||||
#!/bin/sh
|
||||
|
||||
# get data
|
||||
get_data(){
|
||||
DATATYPE=$(uci -q get cellled.@device[0].data_type)
|
||||
case $DATATYPE in
|
||||
mm)
|
||||
PORT=$(uci -q get cellled.@device[0].device_mm)
|
||||
RSSI=$(mmcli -m ${PORT} -J | jsonfilter -e '@["modem"]["generic"]["signal-quality"]["value"]')
|
||||
;;
|
||||
qmi)
|
||||
PORT=$(uci -q get cellled.@device[0].device_qmi)
|
||||
QMICTL="qmicli -p -d $PORT"
|
||||
RSSIDB=$($QMICTL --nas-get-signal-info | awk -F [\'\:\ ] '/RSSI:/{print $4}')
|
||||
RSSI=$(echo $RSSIDB |awk '{printf "%d\n", (100*(1-(-51 - $1)/(-50 - -113)))}')
|
||||
;;
|
||||
uqmi)
|
||||
PORT=$(uci -q get cellled.@device[0].device_qmi)
|
||||
RSSIDB=$(uqmi -d ${PORT} --get-signal-info | jsonfilter -e '@["rssi"]')
|
||||
RSSI=$(echo $RSSIDB |awk '{printf "%d\n", (100*(1-(-51 - $1)/(-51 - -113)))}')
|
||||
;;
|
||||
serial)
|
||||
PORT=$(uci -q get cellled.@device[0].device)
|
||||
RSSI=$(gcom -d ${PORT} -s /etc/gcom/getstrength.gcom | awk -F [:,] '/CSQ:/{printf "%.0f\n", $2*100/31}')
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# get rssi levels
|
||||
get_led_level(){
|
||||
RSSI_MIN=$(uci -q get cellled.@rssi_led[$n].rssi_min)
|
||||
RSSI_MAX=$(uci -q get cellled.@rssi_led[$n].rssi_max)
|
||||
}
|
||||
|
||||
# set rgb light
|
||||
set_led_rgb(){
|
||||
if [ $RSSI -ge $RSSI_MIN -a $RSSI -le $RSSI_MAX ]; then
|
||||
LED_ON=$(echo $RSSI_MIN $RSSI_MAX $RSSI | awk '{printf "%.0f\n", (255/($2-$1)*($3-$1))}')
|
||||
STATE=true
|
||||
else
|
||||
LED_ON=0
|
||||
STATE=false
|
||||
fi
|
||||
}
|
||||
|
||||
# set linear light
|
||||
set_led_linear(){
|
||||
if [ $RSSI -ge $RSSI_MIN -a $RSSI -lt $RSSI_MAX ]; then
|
||||
STATE=true
|
||||
elif [ $RSSI -ge $RSSI_MAX ]; then
|
||||
STATE=true
|
||||
elif [ $RSSI -lt $RSSI_MIN ]; then
|
||||
STATE=false
|
||||
else
|
||||
STATE=false
|
||||
fi
|
||||
}
|
||||
|
||||
# set linear led level
|
||||
if_linear(){
|
||||
LED=$(uci -q get cellled.@rssi_led[$n].led)
|
||||
get_led_level
|
||||
set_led_linear
|
||||
if [ $STATE = true -a $LED ]; then
|
||||
LED_ON=255
|
||||
echo $LED_ON > /sys/class/leds/$LED/brightness
|
||||
else
|
||||
LED_ON=0
|
||||
echo $LED_ON > /sys/class/leds/$LED/brightness
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# set grb led level
|
||||
if_rgb(){
|
||||
PWM=$(uci -q get cellled.@device[0].pwm_mode)
|
||||
LED_R=$(uci -q get cellled.@device[0].red_led)
|
||||
LED_G=$(uci -q get cellled.@device[0].green_led)
|
||||
LED_B=$(uci -q get cellled.@device[0].blue_led)
|
||||
case $TYPE in
|
||||
poor)
|
||||
get_led_level
|
||||
set_led_rgb
|
||||
if [ $STATE = true ]; then
|
||||
R=255
|
||||
G=0
|
||||
if [ "$PWM" = "1" ]; then
|
||||
B=$((255-$LED_ON))
|
||||
else
|
||||
B=255
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
bad)
|
||||
get_led_level
|
||||
set_led_rgb
|
||||
if [ $STATE = true ]; then
|
||||
R=255
|
||||
if [ "$PWM" = "1" ]; then
|
||||
G=$LED_ON
|
||||
else
|
||||
G=0
|
||||
fi
|
||||
B=0
|
||||
fi
|
||||
;;
|
||||
fair)
|
||||
get_led_level
|
||||
set_led_rgb
|
||||
if [ $STATE = true ]; then
|
||||
if [ "$PWM" = "1" ]; then
|
||||
R=$((255-$LED_ON))
|
||||
else
|
||||
R=255
|
||||
fi
|
||||
G=255
|
||||
B=0
|
||||
fi
|
||||
;;
|
||||
good|best|excellend)
|
||||
get_led_level
|
||||
set_led_rgb
|
||||
if [ $STATE = true ]; then
|
||||
R=0
|
||||
G=255
|
||||
B=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ ! $R ]; then R=0; fi
|
||||
if [ ! $G ]; then G=0; fi
|
||||
if [ ! $B ]; then B=0; fi
|
||||
}
|
||||
|
||||
# select type led (rgb or linear)
|
||||
select_led(){
|
||||
if [ "$RGB_LED" = "1" ]; then
|
||||
TYPE=$(uci -q get cellled.@rssi_led[$n].type)
|
||||
if_rgb
|
||||
else
|
||||
if_linear
|
||||
fi
|
||||
}
|
||||
|
||||
# get param
|
||||
get_param(){
|
||||
RSSI=$RSSI
|
||||
if [ $RSSI -lt 0 ]; then
|
||||
RSSI=0
|
||||
elif [ $RSSI -gt 100 ]; then
|
||||
RSSI=100
|
||||
fi
|
||||
LED_ON=0
|
||||
RGB_LED=$(uci -q get cellled.@device[0].rgb_led)
|
||||
SECTIONS=$(uci show cellled | awk -F [\]\[\@=] '/=rssi_led/{print $3}')
|
||||
TIMEOUT=$(uci -q get cellled.@device[0].timeout)
|
||||
if [ -z $RSSI ]; then
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
get_data
|
||||
get_param
|
||||
for n in $SECTIONS; do
|
||||
select_led
|
||||
done
|
||||
if [ "$RGB_LED" = "1" -a $LED_R -a $LED_G -a $LED_B ]; then
|
||||
#echo "${LED_R}=${R} ${LED_G}=${G} ${LED_B}=${B}"
|
||||
echo $R > /sys/class/leds/$LED_R/brightness
|
||||
echo $G > /sys/class/leds/$LED_G/brightness
|
||||
echo $B > /sys/class/leds/$LED_B/brightness
|
||||
fi
|
||||
|
||||
sleep $TIMEOUT
|
51
dns-proxy/Makefile
Normal file
@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2014-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dns-proxy
|
||||
PKG_VERSION:=0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=https://github.com/wzhd/dns-tcp-socks-proxy.git
|
||||
PKG_SOURCE_VERSION:=null
|
||||
|
||||
PKG_MAINTAINER:=qiuchengxuan <qiuchengxuan@gmail.com>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dns-proxy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=
|
||||
TITLE:=A simple dns proxy to tunnel DNS requests over a socks proxy
|
||||
endef
|
||||
|
||||
define Package/dns-proxy/conffiles
|
||||
/etc/dns-proxy.conf
|
||||
endef
|
||||
|
||||
define Package/dns-proxy/description
|
||||
A simple dns proxy to tunnel DNS requests over a socks proxy (for example, over ssh or Tor). This can come in handy when setting up transparent proxies.
|
||||
It chooses a random DNS server for each request from the file "resolv.conf" which is a newline delimited list of DNS servers.
|
||||
The daemon must be run as root in order for it to bind to port 53.
|
||||
endef
|
||||
|
||||
define Package/dns-proxy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dns_proxy $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) files/dns_proxy.init $(1)/etc/init.d/dns_proxy
|
||||
$(INSTALL_CONF) files/dns_proxy.conf $(1)/etc/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/resolv.conf $(1)/etc/dns_proxy_resolv.conf
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dns-proxy))
|
23
dns-proxy/files/dns_proxy.conf
Normal file
@ -0,0 +1,23 @@
|
||||
# set the port of the socks proxy
|
||||
socks_port = 1080
|
||||
|
||||
# set the address of the socks proxy
|
||||
socks_addr = 127.0.0.1
|
||||
|
||||
# set the listen address of the dns proxy
|
||||
listen_addr = 127.0.0.1
|
||||
|
||||
# set the listen port of the dns proxy
|
||||
listen_port = 5353
|
||||
|
||||
# set the username to drop to
|
||||
set_user = nobody
|
||||
|
||||
# set the group name to drop to
|
||||
set_group = nogroup
|
||||
|
||||
# file to read as resolv.conf
|
||||
resolv_conf = /etc/dns_proxy_resolv.conf
|
||||
|
||||
# file to log to, should be /dev/null unless debugging
|
||||
log_file = /dev/null
|
29
dns-proxy/files/dns_proxy.init
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
START=90
|
||||
|
||||
# check if configuration exists
|
||||
[ -e "/etc/dns_proxy.conf" ] || exit 0
|
||||
|
||||
start() {
|
||||
if [ `pgrep dns_proxy` ]; then
|
||||
echo "dns_proxy is already running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/usr/sbin/dns_proxy /etc/dns_proxy.conf
|
||||
}
|
||||
|
||||
stop() {
|
||||
if [ -z `pgrep dns_proxy` ]; then
|
||||
echo "dns_proxy is not running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/bin/echo -n "stopping dns_proxy ..."
|
||||
|
||||
# kill the process
|
||||
/bin/kill -9 `pgrep dns_proxy`
|
||||
echo " done"
|
||||
}
|
12
dns-proxy/patches/0001-use-cc.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 6452bd1..cc915d8 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
FLAGS=-Wall -Wextra
|
||||
all:
|
||||
- gcc $(FLAGS) -o dns_proxy dns_proxy.c
|
||||
+ $(CC) $(FLAGS) -o dns_proxy dns_proxy.c
|
||||
.PHONY : clean
|
||||
clean :
|
||||
-rm dns_proxy
|
23
dns-proxy/patches/0002-daemonize-with-fork.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff --git a/dns_proxy.c b/dns_proxy.c
|
||||
index 87083bf..519b223 100644
|
||||
--- a/dns_proxy.c
|
||||
+++ b/dns_proxy.c
|
||||
@@ -219,10 +219,14 @@ int udp_listener() {
|
||||
error("[!] Error opening logfile.");
|
||||
}
|
||||
|
||||
- if(geteuid() == 0) {
|
||||
- setuid(getpwnam(USERNAME)->pw_uid);
|
||||
- setgid(getgrnam(GROUPNAME)->gr_gid);
|
||||
- }
|
||||
+ printf("[*] No errors, backgrounding process.\n");
|
||||
+
|
||||
+ // daemonize the process.
|
||||
+ if(fork() != 0) { exit(0); }
|
||||
+ if(fork() != 0) { exit(0); }
|
||||
+
|
||||
+ setuid(getpwnam(USERNAME)->pw_uid);
|
||||
+ setgid(getgrnam(GROUPNAME)->gr_gid);
|
||||
socklen_t dns_client_size = sizeof(struct sockaddr_in);
|
||||
|
||||
// setup SIGCHLD handler to kill off zombie children
|
43
ethstatus/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethstatus
|
||||
PKG_VERSION:=0.4.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=http://deb.debian.org/debian/pool/main/e/ethstatus/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=console-based ethernet statistics monitor
|
||||
URL:=https://packages.debian.org/unstable/ethstatus
|
||||
DEPENDS:=+libncurses
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Ethstatus is a console-based monitoring utility for
|
||||
displaying statistical data of the ethernet interface
|
||||
on a quantity basis. It is similar to iptraf but is meant
|
||||
to run as a permanent console task to monitor the network
|
||||
load.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
8
ethstatus/patches/0001-version.patch
Normal file
@ -0,0 +1,8 @@
|
||||
--- ethstatus-0.4.9.orig/ethstatus.h
|
||||
+++ ethstatus-0.4.9/ethstatus.h
|
||||
@@ -1,4 +1,4 @@
|
||||
-#define VERSION "0.4.8"
|
||||
+#define VERSION "0.4.9"
|
||||
#define AUTHOR "Gabriel Montenegro / Christoph Haas / Marcio Souza"
|
||||
|
||||
#define LED_RX 1
|
83
fullconenat/Makefile
Normal file
@ -0,0 +1,83 @@
|
||||
#
|
||||
# Copyright (C) 2018 Chion Tang <tech@chionlab.moe>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=fullconenat
|
||||
PKG_RELEASE:=14
|
||||
|
||||
PKG_SOURCE_DATE:=2022-02-13
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/llccd/netfilter-full-cone-nat.git
|
||||
PKG_SOURCE_VERSION:=108a36cbdca17e68c9e6e7fd5e26156a88f738e8
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iptables-mod-fullconenat
|
||||
SUBMENU:=Firewall
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=FULLCONENAT iptables extension
|
||||
DEPENDS:=+iptables +kmod-ipt-fullconenat
|
||||
MAINTAINER:=Chion Tang <tech@chionlab.moe>
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-fullconenat/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libipt_FULLCONENAT.so $(1)/usr/lib/iptables
|
||||
endef
|
||||
|
||||
define Package/ip6tables-mod-fullconenat
|
||||
SUBMENU:=Firewall
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=FULLCONENAT ip6tables extension
|
||||
DEPENDS:=ip6tables +kmod-nf-nat6 +kmod-ipt-fullconenat
|
||||
MAINTAINER:=Chion Tang <tech@chionlab.moe>
|
||||
endef
|
||||
|
||||
define Package/ip6tables-mod-fullconenat/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libip6t_FULLCONENAT.so $(1)/usr/lib/iptables
|
||||
endef
|
||||
|
||||
define KernelPackage/ipt-fullconenat
|
||||
SUBMENU:=Netfilter Extensions
|
||||
TITLE:=FULLCONENAT netfilter module
|
||||
DEPENDS:=+kmod-nf-ipt +kmod-nf-nat
|
||||
MAINTAINER:=Chion Tang <tech@chionlab.moe>
|
||||
KCONFIG:= \
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y
|
||||
FILES:=$(PKG_BUILD_DIR)/xt_FULLCONENAT.ko
|
||||
endef
|
||||
|
||||
include $(INCLUDE_DIR)/kernel-defaults.mk
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(CP) ./files/Makefile $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(BUILDFLAGS)" \
|
||||
modules
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iptables-mod-fullconenat))
|
||||
$(eval $(call BuildPackage,ip6tables-mod-fullconenat))
|
||||
$(eval $(call KernelPackage,ipt-fullconenat))
|
11
fullconenat/files/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
all: libipt_FULLCONENAT.so libip6t_FULLCONENAT.so
|
||||
libipt_FULLCONENAT.so: libipt_FULLCONENAT.o
|
||||
$(CC) -shared -lxtables -o $@ $^;
|
||||
libipt_FULLCONENAT.o: libipt_FULLCONENAT.c
|
||||
$(CC) ${CFLAGS} -fPIC -D_INIT=$*_init -c -o $@ $<;
|
||||
libip6t_FULLCONENAT.so: libip6t_FULLCONENAT.o
|
||||
$(CC) -shared -lxtables -o $@ $^;
|
||||
libip6t_FULLCONENAT.o: libip6t_FULLCONENAT.c
|
||||
$(CC) ${CFLAGS} -fPIC -D_INIT=$*_init -c -o $@ $<;
|
||||
|
||||
obj-m += xt_FULLCONENAT.o
|
99
homebox/Makefile
Normal file
@ -0,0 +1,99 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=homebox
|
||||
PKG_VERSION:=0.0.0-dev.2020062901
|
||||
PKG_RELEASE:=14
|
||||
|
||||
PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/XGHeaven/homebox/archive/refs/tags/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host homebox/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/${PKG_NAME}
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=A Toolbox for Home Local Networks
|
||||
URL:=https://github.com/XGHeaven/homebox
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
A Toolbox for Home Local Networks Speed Test
|
||||
endef
|
||||
|
||||
GO_PKG_BUILD_VARS += GO111MODULE=auto
|
||||
TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
|
||||
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
define Build/Configure
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR)/server; \
|
||||
$(GO_PKG_VARS) \
|
||||
go get -d -modcacherw; \
|
||||
)
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR)/server; \
|
||||
GOPATH=$(PKG_BUILD_DIR)/.go_work/build \
|
||||
go install -modcacherw github.com/go-bindata/go-bindata/...@latest; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
rm -rf $(PKG_BUILD_DIR)/build/static
|
||||
mkdir -p $(PKG_BUILD_DIR)/build
|
||||
$(CP) $(HOST_BUILD_DIR)/build/static $(PKG_BUILD_DIR)/build/
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR); \
|
||||
$(GO_PKG_VARS) PATH=$(PKG_BUILD_DIR)/.go_work/build/bin:$$$$PATH \
|
||||
$(MAKE) build-server; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/server $(1)/usr/bin/homebox
|
||||
$(INSTALL_CONF) ./files/homebox.config $(1)/etc/config/homebox
|
||||
$(INSTALL_BIN) ./files/homebox.init $(1)/etc/init.d/homebox
|
||||
$(INSTALL_BIN) ./files/homebox.uci-default $(1)/etc/uci-defaults/homebox
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/homebox
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -f /etc/uci-defaults/homebox ] && /etc/uci-defaults/homebox && rm -f /etc/uci-defaults/homebox
|
||||
fi
|
||||
endef
|
||||
|
||||
define Host/Configure
|
||||
cd $(HOST_BUILD_DIR)/web && rm -f package-lock.json && npm --cache-min 1440 install
|
||||
endef
|
||||
|
||||
define Host/Compile
|
||||
cd $(HOST_BUILD_DIR) && $(MAKE) build-web
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
endef
|
||||
|
||||
define Host/Clean
|
||||
rm -f $(HOST_BUILD_DIR)/build/static
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,homebox))
|
2
homebox/files/homebox.config
Normal file
@ -0,0 +1,2 @@
|
||||
config homebox
|
||||
option 'enabled' '0'
|
25
homebox/files/homebox.init
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled $1 enabled 1
|
||||
config_get_bool logger $1 logger
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load homebox
|
||||
config_foreach get_config homebox
|
||||
[ $enabled != 1 ] && return 1
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/bin/homebox
|
||||
[ "$logger" == 1 ] && procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "homebox"
|
||||
}
|
10
homebox/files/homebox.uci-default
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@homebox[-1]
|
||||
add ucitrack homebox
|
||||
set ucitrack.@homebox[-1].init=homebox
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
exit 0
|
674
luci-app-3ginfo/LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
20
luci-app-3ginfo/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright 2020-2021 Rafał Wabik - IceG - From eko.one.pl forum
|
||||
# Licensed to the public under the Apache License 2.0.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-3ginfo
|
||||
LUCI_TITLE:=LuCI panel for 3ginfo
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+3ginfo-text +luci-compat
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
define Package/luci-app-3ginfo/postinst
|
||||
#!/bin/sh
|
||||
rm -rf /tmp/luci-indexcache
|
||||
rm -rf /tmp/luci-modulecache/
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
After Width: | Height: | Size: 10 KiB |
BIN
luci-app-3ginfo/htdocs/luci-static/resources/icons/3ginfo-0.png
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.4 KiB |
21
luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- Copyright 2020 IceG <eko.one.pl>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
module("luci.controller.modem.3ginfo", package.seeall)
|
||||
|
||||
function index()
|
||||
|
||||
entry({"admin", "modem"}, firstchild(), "Modem", 30).dependent=false
|
||||
entry({"admin", "modem", "3ginfo"}, alias("admin", "modem", "3ginfo", "3gdetail"), translate("Information about 3G/4G connection"), 10).acl_depends={ "luci-app-3ginfo" }
|
||||
entry({"admin", "modem", "3ginfo", "3gdetail"},template("modem/3gdetail"),translate("Details"), 10)
|
||||
entry({"admin", "modem", "3ginfo", "3gconfig"},cbi("modem/3gconfig"),translate("Configuration"), 20)
|
||||
entry({"admin", "modem", "3ginfo", "devicedata"}, call("action_devicedata")).leaf = true
|
||||
|
||||
end
|
||||
|
||||
function action_devicedata()
|
||||
local fs = require "nixio.fs"
|
||||
local data = luci.sys.exec("3ginfo json")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write(data)
|
||||
end
|
36
luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua
Normal file
@ -0,0 +1,36 @@
|
||||
-- Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||
-- Licensed to the GNU General Public License v3.0.
|
||||
|
||||
require("nixio.fs")
|
||||
|
||||
local m
|
||||
local s
|
||||
local dev, pin, lang
|
||||
local try_devices = nixio.fs.glob("/dev/tty[A-Z][A-Z]*")
|
||||
|
||||
m = Map("3ginfo", translate("Configuration 3ginfo"),
|
||||
translate("Configuration panel for the 3ginfo application."))
|
||||
|
||||
s = m:section(TypedSection, "3ginfo", "<p> </p>" .. translate(""))
|
||||
s.anonymous = true
|
||||
|
||||
s:option(Value, "network", translate("Network"))
|
||||
s.rmempty = true
|
||||
|
||||
dev = s:option(Value, "device", translate("Device"))
|
||||
if try_devices then
|
||||
local node
|
||||
for node in try_devices do
|
||||
dev:value(node, node)
|
||||
end
|
||||
end
|
||||
|
||||
pin = s:option(Value, "pincode", translate("SIM PIN (optional)"))
|
||||
pin.default = ""
|
||||
|
||||
lang = s:option(Value, "language", translate("Language"))
|
||||
lang:value("pl", "Polski")
|
||||
lang:value("en", "English")
|
||||
lang.default = "pl"
|
||||
|
||||
return m
|
157
luci-app-3ginfo/luasrc/view/modem/3gdetail.htm
Normal file
@ -0,0 +1,157 @@
|
||||
<%+header%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
|
||||
XHR.poll(0, '<%=build_url("admin/modem/3ginfo/devicedata")%>', null,
|
||||
function(x, data)
|
||||
{
|
||||
|
||||
|
||||
var icon2;
|
||||
var p = (data.signal);
|
||||
|
||||
// conn data status
|
||||
var conn;
|
||||
var cn = (data.status)
|
||||
if (cn == "CONNECTED")
|
||||
conn = "<%:CONNECTED%>";
|
||||
else
|
||||
conn = "<%:DISCONNECTED%>";
|
||||
|
||||
if (data.signal < 0)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-0.png";
|
||||
else if (data.signal == 0)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-0.png";
|
||||
else if (data.signal < 20)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-0-20.png";
|
||||
else if (data.signal < 40)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-20-40.png";
|
||||
else if (data.signal < 60)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-40-60.png";
|
||||
else if (data.signal < 80)
|
||||
icon2 = "<%=resource%>/icons/3ginfo-60-80.png";
|
||||
else
|
||||
icon2 = "<%=resource%>/icons/3ginfo-80-100.png";
|
||||
|
||||
if (e = document.getElementById('signal'))
|
||||
if (e)
|
||||
e.innerHTML = String.format('<medium>%d%%</medium></br>' + '<img style="padding-left: 10px;" src="%s"/>', p, icon2);
|
||||
|
||||
|
||||
if (e = document.getElementById('statu'))
|
||||
{
|
||||
|
||||
e.innerHTML = (conn);
|
||||
|
||||
}
|
||||
|
||||
if (e = document.getElementById('conn_tim'))
|
||||
e.innerHTML = String.format(data.conn_time);
|
||||
|
||||
if (e = document.getElementById('iface_rx'))
|
||||
e.innerHTML = String.format(data.iface_rx);
|
||||
|
||||
if (e = document.getElementById('iface_tx'))
|
||||
e.innerHTML = String.format(data.iface_tx);
|
||||
|
||||
if (e = document.getElementById('mod'))
|
||||
e.innerHTML = String.format(data.mode);
|
||||
|
||||
if (e = document.getElementById('operato'))
|
||||
e.innerHTML = String.format(data.operator_name);
|
||||
|
||||
if (e = document.getElementById('signa'))
|
||||
e.innerHTML = String.format(data.signal+"%");
|
||||
|
||||
if (e = document.getElementById('devic'))
|
||||
e.innerHTML = String.format(data.device);
|
||||
|
||||
|
||||
if (e = document.getElementById('omcc'))
|
||||
e.innerHTML = String.format(data.operator_mcc + " " + data.operator_mnc);
|
||||
|
||||
if (e = document.getElementById('cs'))
|
||||
e.innerHTML = String.format(data.csq);
|
||||
|
||||
if (e = document.getElementById('rss'))
|
||||
e.innerHTML = String.format(data.rssi + " dBm");
|
||||
|
||||
if (e = document.getElementById('rsc'))
|
||||
e.innerHTML = String.format(data.rscp + " dBm");
|
||||
|
||||
if (e = document.getElementById('eci'))
|
||||
e.innerHTML = String.format(data.ecio + " dB");
|
||||
|
||||
if (e = document.getElementById('rsr'))
|
||||
e.innerHTML = String.format(data.rsrp + " dBm");
|
||||
|
||||
if (e = document.getElementById('sinrr'))
|
||||
e.innerHTML = String.format(data.sinr + " dB");
|
||||
|
||||
if (e = document.getElementById('lac_he'))
|
||||
e.innerHTML = String.format(data.lac_hex + ' (' + data.lac_dec + ')' );
|
||||
|
||||
|
||||
if (e = document.getElementById('cid_he'))
|
||||
e.innerHTML = String.format(data.cid_hex + ' (' + data.cid_dec + ')' );
|
||||
|
||||
|
||||
if (e = document.getElementById('rsrqq'))
|
||||
e.innerHTML = String.format(data.rsrq + " dB");
|
||||
|
||||
if (e = document.getElementById('tacc'))
|
||||
e.innerHTML = String.format(data.tac_hex + ' (' + data.tac_dec + ')' );
|
||||
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
|
||||
<div class="cbi-section">
|
||||
|
||||
<h2>3ginfo</h2>
|
||||
<h4><%:Information about 3G/4G connection%></h4>
|
||||
|
||||
<div class="table" width="100%">
|
||||
|
||||
<div class="tr"><div class="td left" width="33%"><%:Status:%></div><div class="td left" id="statu">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"><%:Connection time:%></div><div class="td left" id="conn_tim">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"><%:Downloaded:%></div><div class="td left" id="iface_rx">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"><%:Uploaded:%></div><div class="td left" id="iface_tx">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"><%:Mode:%></div><div class="td left" id="mod">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"><%:Operator:%></div><div class="td left" id="operato">-</div></div>
|
||||
|
||||
<div class="tr"><div class="td left" width="33%"><%:Signal strength:%></div><div class="td left" id="signal">-</div></div>
|
||||
|
||||
<div class="tr"><div class="td left" width="33%"><%:Modem type:%></div><div class="td left" id="devic">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"></div><div class="td left"></div></div>
|
||||
</div>
|
||||
<div style="float: left;"><div class="ifacebadge"><a href="https://eko.one.pl/forum/viewtopic.php?pid=240837#p240837">e1</a></div> </div>
|
||||
|
||||
<details>
|
||||
<summary><%:Additional information%></summary>
|
||||
|
||||
<div class="table" width="100%"></div>
|
||||
|
||||
<div class="table" width="100%">
|
||||
<div class="tr"><div class="td left" width="33%">MCC MNC: </div><div class="td left" id="omcc">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">CSQ: </div><div class="td left" id="cs">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">RSSI: </div><div class="td left" id="rss">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">RSCP: </div><div class="td left" id="rsc">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">Ec/IO: </div><div class="td left" id="eci">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">RSRP: </div><div class="td left" id="rsr">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">SINR: </div><div class="td left" id="sinrr">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">RSRQ: </div><div class="td left" id="rsrqq">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">LAC: </div><div class="td left" id="lac_he">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">CID: </div><div class="td left" id="cid_he">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%">TAC: </div><div class="td left" id="tacc">-</div></div>
|
||||
<div class="tr"><div class="td left" width="33%"></div><div class="td left"></div></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<%+footer%>
|
78
luci-app-3ginfo/po/en/3ginfo.po
Normal file
@ -0,0 +1,78 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:9
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:10
|
||||
msgid "Details"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:11
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:106
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:110
|
||||
msgid "Status:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:111
|
||||
msgid "Connection time:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:112
|
||||
msgid "Downloaded:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:113
|
||||
msgid "Uploaded:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:114
|
||||
msgid "Mode:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:115
|
||||
msgid "Operator:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:117
|
||||
msgid "Signal strength:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:119
|
||||
msgid "Modem type:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:124
|
||||
msgid "Additional information"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:11
|
||||
msgid "Configuration 3ginfo"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:12
|
||||
msgid "Configuration panel for the 3ginfo application."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:17
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:20
|
||||
msgid "Device"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:28
|
||||
msgid "SIM PIN (optional)"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:31
|
||||
msgid "Language"
|
||||
msgstr ""
|
84
luci-app-3ginfo/po/pl/3ginfo.po
Normal file
@ -0,0 +1,84 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:9
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr "Informacja o statusie połączenia 3G/4G"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:10
|
||||
msgid "Details"
|
||||
msgstr "Szczegóły"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:11
|
||||
msgid "Configuration"
|
||||
msgstr "Konfiguracja"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:106
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr "Informacja o statusie połączenia 3G/4G"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:110
|
||||
msgid "Status:"
|
||||
msgstr "Status:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:111
|
||||
msgid "Connection time:"
|
||||
msgstr "Czas połączenia:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:112
|
||||
msgid "Downloaded:"
|
||||
msgstr "Pobrano danych:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:113
|
||||
msgid "Uploaded:"
|
||||
msgstr "Wysłano danych:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:114
|
||||
msgid "Mode:"
|
||||
msgstr "Tryb pracy:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:115
|
||||
msgid "Operator:"
|
||||
msgstr "Operator:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:117
|
||||
msgid "Signal strength:"
|
||||
msgstr "Siła sygnału:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:119
|
||||
msgid "Modem type:"
|
||||
msgstr "Typ modemu:"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:124
|
||||
msgid "Additional information"
|
||||
msgstr "Informacje dodatkowe"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:11
|
||||
msgid "Configuration 3ginfo"
|
||||
msgstr "Konfiguracja 3ginfo"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:12
|
||||
msgid "Configuration panel for the 3ginfo application."
|
||||
msgstr "Panel konfiguracyjny dla aplikacji 3ginfo."
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:17
|
||||
msgid "Network"
|
||||
msgstr "Sieć"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:20
|
||||
msgid "Device"
|
||||
msgstr "Urządzenie"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:28
|
||||
msgid "SIM PIN (optional)"
|
||||
msgstr "PIN dla SIM (opcjonalny)"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:31
|
||||
msgid "Language"
|
||||
msgstr "Język"
|
||||
|
||||
msgid "CONNECTED"
|
||||
msgstr "Połączony"
|
||||
|
||||
msgid "DISCONNECTED"
|
||||
msgstr "Rozłączony"
|
78
luci-app-3ginfo/po/template/3ginfo.po
Normal file
@ -0,0 +1,78 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:9
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:10
|
||||
msgid "Details"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/controller/modem/3ginfo.lua:11
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:106
|
||||
msgid "Information about 3G/4G connection"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:110
|
||||
msgid "Status:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:111
|
||||
msgid "Connection time:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:112
|
||||
msgid "Downloaded:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:113
|
||||
msgid "Uploaded:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:114
|
||||
msgid "Mode:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:115
|
||||
msgid "Operator:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:117
|
||||
msgid "Signal strength:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:119
|
||||
msgid "Modem type:"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/view/modem/3gdetail.lua:124
|
||||
msgid "Additional information"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:11
|
||||
msgid "Configuration 3ginfo"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:12
|
||||
msgid "Configuration panel for the 3ginfo application."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:17
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:20
|
||||
msgid "Device"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:28
|
||||
msgid "SIM PIN (optional)"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-3ginfo/luasrc/model/cbi/modem/3gconfig.lua:31
|
||||
msgid "Language"
|
||||
msgstr ""
|