termux-connecting 1.1.10 → 1.1.12

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
  #!/usr/bin/env bash
2
2
  set -e
3
3
 
4
- VERSION="1.1.10"
4
+ VERSION="1.1.12"
5
5
  CONFIG_DIR="$HOME/.config/termux-connecting"
6
6
  CONFIG_FILE="$CONFIG_DIR/config"
7
7
  SSH_PORT=8022
@@ -43,6 +43,12 @@ title "TERMUX CONNECTING — Setup"
43
43
  echo "Memeriksa dan mengkonfigurasi Termux..."
44
44
  echo "----------------------------------------"
45
45
 
46
+ # Pastikan coreutils (timeout) tersedia
47
+ if ! command -v timeout >/dev/null; then
48
+ echo " Install coreutils untuk timeout..."
49
+ pkg install -y coreutils
50
+ fi
51
+
46
52
  title "1. Update & Upgrade Paket"
47
53
  echo "Menjalankan pkg update && pkg upgrade..."
48
54
  if timeout 300 pkg update -y && timeout 300 pkg upgrade -y; then
@@ -104,8 +110,21 @@ fi
104
110
 
105
111
  title "4. Informasi Koneksi"
106
112
  USERNAME=$(whoami)
107
- IP=$(ip -o -4 addr show | awk '{print $4}' | cut -d/ -f1 | grep -v 127.0.0.1 | head -n1)
108
113
 
114
+ # Deteksi IP — coba beberapa metode
115
+ IP=""
116
+ if command -v ip; then
117
+ IP=$(ip -4 addr show | awk '/inet /{print $2}' | cut -d/ -f1 | grep -v 127.0.0.1 | head -1)
118
+ fi
119
+ if [ -z "$IP" ] && command -v ifconfig; then
120
+ IP=$(ifconfig | awk '/inet /{print $2}' | grep -v 127.0.0.1 | head -1)
121
+ fi
122
+ if [ -z "$IP" ] && command -v hostname; then
123
+ IP=$(hostname -I 2>/dev/null | awk '{print $1}')
124
+ fi
125
+ if [ -z "$IP" ] && [ -d /data/data/com.termux ]; then
126
+ IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{print $7}' | head -1)
127
+ fi
109
128
  if [ -z "$IP" ]; then
110
129
  IP="(tidak terdeteksi — pastikan WiFi/data aktif)"
111
130
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",