termux-connecting 1.1.51 → 1.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/termux-connecting +39 -1
- package/package.json +1 -1
package/bin/termux-connecting
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/data/data/com.termux/files/usr/bin/bash
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
|
-
VERSION="1.1.
|
|
4
|
+
VERSION="1.1.53"
|
|
5
5
|
|
|
6
6
|
GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; CYAN='\033[0;36m'; NC='\033[0m'
|
|
7
7
|
info() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
@@ -361,6 +361,44 @@ echo " IP : ${IP:-tidak terdeteksi}"
|
|
|
361
361
|
echo " Port : 8022"
|
|
362
362
|
echo ""
|
|
363
363
|
|
|
364
|
+
# ─── Cek Stabilitas Jaringan ───
|
|
365
|
+
title "6. Cek Stabilitas Jaringan"
|
|
366
|
+
STABLE=false
|
|
367
|
+
if [ -n "$IP" ]; then
|
|
368
|
+
echo " Ping gateway untuk verifikasi koneksi..."
|
|
369
|
+
gateway=$(timeout 3 ip route 2>/dev/null | awk '/default via/{print $3}' | head -1)
|
|
370
|
+
if [ -z "$gateway" ] && command -v getprop >/dev/null; then
|
|
371
|
+
iface=$(getprop wifi.interface 2>/dev/null)
|
|
372
|
+
[ -z "$iface" ] && iface="wlan0"
|
|
373
|
+
gateway=$(getprop dhcp.${iface}.gateway 2>/dev/null)
|
|
374
|
+
fi
|
|
375
|
+
if [ -n "$gateway" ]; then
|
|
376
|
+
echo " Gateway: $gateway"
|
|
377
|
+
result=$(timeout 5 ping -c 2 -W 2 "$gateway" 2>&1)
|
|
378
|
+
loss=$(echo "$result" | awk '/loss/{print $6}' | tr -d '%')
|
|
379
|
+
if [ -n "$loss" ] && [ "$loss" -lt 1 ] 2>/dev/null; then
|
|
380
|
+
STABLE=true
|
|
381
|
+
info "Jaringan stabil (0% loss)"
|
|
382
|
+
else
|
|
383
|
+
error "Jaringan tidak stabil (packet loss: ${loss:-100}%)"
|
|
384
|
+
echo " Setup dibatalkan."
|
|
385
|
+
echo ""
|
|
386
|
+
echo " Perbaiki:"
|
|
387
|
+
echo " • Dekatkan HP ke router"
|
|
388
|
+
echo " • Matikan data seluler / VPN"
|
|
389
|
+
echo " • Nonaktifkan hemat daya"
|
|
390
|
+
echo " • Ulangi: termux-connecting -y"
|
|
391
|
+
exit 1
|
|
392
|
+
fi
|
|
393
|
+
else
|
|
394
|
+
warn "Tidak bisa deteksi gateway — lewati pengecekan"
|
|
395
|
+
STABLE=true
|
|
396
|
+
fi
|
|
397
|
+
else
|
|
398
|
+
warn "Tidak ada IP — lewati pengecekan"
|
|
399
|
+
fi
|
|
400
|
+
echo ""
|
|
401
|
+
|
|
364
402
|
CONNECTION_OK=false
|
|
365
403
|
|
|
366
404
|
if [ -z "$IP" ]; then
|