termux-connecting 1.1.51 → 1.1.52

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.
@@ -1,7 +1,7 @@
1
1
  #!/data/data/com.termux/files/usr/bin/bash
2
2
  set -e
3
3
 
4
- VERSION="1.1.51"
4
+ VERSION="1.1.52"
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,50 @@ 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
+ rtt=$(echo "$result" | awk -F'/' '/rtt/{print $5}')
380
+ if [ -n "$loss" ] && [ "$loss" -lt 50 ] 2>/dev/null; then
381
+ STABLE=true
382
+ info "Jaringan stabil (packet loss: ${loss}%, RTT: ${rtt:-N/A}ms)"
383
+ else
384
+ warn "Jaringan tidak stabil (packet loss: ${loss:-100}%)"
385
+ echo ""
386
+ echo " Kemungkinan penyebab:"
387
+ echo " • Sinyal WiFi lemah — dekatkan ke router"
388
+ echo " • Router sibuk / banyak perangkat"
389
+ echo " • HP dalam mode hemat daya"
390
+ echo ""
391
+ if confirm "Tetap lanjutkan setup" "n"; then
392
+ STABLE=true
393
+ else
394
+ echo ""
395
+ info "Setup dibatalkan. Perbaiki jaringan lalu ulangi."
396
+ exit 0
397
+ fi
398
+ fi
399
+ else
400
+ warn "Tidak bisa deteksi gateway — lewati pengecekan"
401
+ STABLE=true
402
+ fi
403
+ else
404
+ warn "Tidak ada IP — lewati pengecekan"
405
+ fi
406
+ echo ""
407
+
364
408
  CONNECTION_OK=false
365
409
 
366
410
  if [ -z "$IP" ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.51",
3
+ "version": "1.1.52",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",