termux-connecting 1.1.55 → 1.1.56

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.
@@ -165,7 +165,7 @@ cmd_connection() {
165
165
  echo " Ping $SSH_HOST untuk verifikasi..."
166
166
  if command -v ping >/dev/null; then
167
167
  result=$(run_timeout 5 ping -c 2 -W 2 "$SSH_HOST" 2>&1)
168
- loss=$(echo "$result" | awk '/loss/{print $6}' | tr -d '%')
168
+ loss=$(echo "$result" | grep -oE '[0-9]+(\.[0-9]+)?%' | head -1 | tr -d '%' | cut -d. -f1)
169
169
  if [ -n "$loss" ] && [ "$loss" -lt 1 ] 2>/dev/null; then
170
170
  rtt=$(echo "$result" | awk -F'/' '/rtt/{print $5}')
171
171
  info "HP reachable (RTT: ${rtt}ms)"
@@ -1,7 +1,7 @@
1
1
  #!/data/data/com.termux/files/usr/bin/bash
2
2
  set -e
3
3
 
4
- VERSION="1.1.55"
4
+ VERSION="1.1.56"
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"; }
@@ -261,7 +261,7 @@ if [ -z "$gateway" ] && command -v getprop >/dev/null; then
261
261
  fi
262
262
  if [ -n "$gateway" ]; then
263
263
  result=$(run_timeout 5 ping -c 2 -W 2 "$gateway" 2>&1)
264
- loss=$(echo "$result" | awk '/loss/{print $6}' | tr -d '%')
264
+ loss=$(echo "$result" | grep -oE '[0-9]+(\.[0-9]+)?%' | head -1 | tr -d '%' | cut -d. -f1)
265
265
  if [ -n "$loss" ] && [ "$loss" -lt 1 ] 2>/dev/null; then
266
266
  info "Jaringan stabil (0% loss) — IP: $ip"
267
267
  else
@@ -414,7 +414,7 @@ gateway=$(run_timeout 3 ip route 2>/dev/null | awk '/default via/{print $3}' | h
414
414
  if [ -n "$gateway" ]; then
415
415
  echo " Gateway: $gateway"
416
416
  result=$(run_timeout 5 ping -c 2 -W 2 "$gateway" 2>&1)
417
- loss=$(echo "$result" | awk '/loss/{print $6}' | tr -d '%')
417
+ loss=$(echo "$result" | grep -oE '[0-9]+(\.[0-9]+)?%' | head -1 | tr -d '%' | cut -d. -f1)
418
418
  if [ -n "$loss" ] && [ "$loss" -lt 1 ] 2>/dev/null; then
419
419
  STABLE=true
420
420
  info "Jaringan stabil (0% loss)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.55",
3
+ "version": "1.1.56",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",