termux-connecting 1.1.52 → 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 +11 -17
- 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"; }
|
|
@@ -376,25 +376,19 @@ if [ -n "$IP" ]; then
|
|
|
376
376
|
echo " Gateway: $gateway"
|
|
377
377
|
result=$(timeout 5 ping -c 2 -W 2 "$gateway" 2>&1)
|
|
378
378
|
loss=$(echo "$result" | awk '/loss/{print $6}' | tr -d '%')
|
|
379
|
-
|
|
380
|
-
if [ -n "$loss" ] && [ "$loss" -lt 50 ] 2>/dev/null; then
|
|
379
|
+
if [ -n "$loss" ] && [ "$loss" -lt 1 ] 2>/dev/null; then
|
|
381
380
|
STABLE=true
|
|
382
|
-
info "Jaringan stabil (
|
|
381
|
+
info "Jaringan stabil (0% loss)"
|
|
383
382
|
else
|
|
384
|
-
|
|
383
|
+
error "Jaringan tidak stabil (packet loss: ${loss:-100}%)"
|
|
384
|
+
echo " Setup dibatalkan."
|
|
385
385
|
echo ""
|
|
386
|
-
echo "
|
|
387
|
-
echo " •
|
|
388
|
-
echo " •
|
|
389
|
-
echo " •
|
|
390
|
-
echo ""
|
|
391
|
-
|
|
392
|
-
STABLE=true
|
|
393
|
-
else
|
|
394
|
-
echo ""
|
|
395
|
-
info "Setup dibatalkan. Perbaiki jaringan lalu ulangi."
|
|
396
|
-
exit 0
|
|
397
|
-
fi
|
|
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
|
|
398
392
|
fi
|
|
399
393
|
else
|
|
400
394
|
warn "Tidak bisa deteksi gateway — lewati pengecekan"
|