termux-connecting 1.1.10 → 1.1.11

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.11"
5
5
  CONFIG_DIR="$HOME/.config/termux-connecting"
6
6
  CONFIG_FILE="$CONFIG_DIR/config"
7
7
  SSH_PORT=8022
@@ -104,8 +104,21 @@ fi
104
104
 
105
105
  title "4. Informasi Koneksi"
106
106
  USERNAME=$(whoami)
107
- IP=$(ip -o -4 addr show | awk '{print $4}' | cut -d/ -f1 | grep -v 127.0.0.1 | head -n1)
108
107
 
108
+ # Deteksi IP — coba beberapa metode
109
+ IP=""
110
+ if command -v ip; then
111
+ IP=$(ip -4 addr show | awk '/inet /{print $2}' | cut -d/ -f1 | grep -v 127.0.0.1 | head -1)
112
+ fi
113
+ if [ -z "$IP" ] && command -v ifconfig; then
114
+ IP=$(ifconfig | awk '/inet /{print $2}' | grep -v 127.0.0.1 | head -1)
115
+ fi
116
+ if [ -z "$IP" ] && command -v hostname; then
117
+ IP=$(hostname -I 2>/dev/null | awk '{print $1}')
118
+ fi
119
+ if [ -z "$IP" ] && [ -d /data/data/com.termux ]; then
120
+ IP=$(ip route get 1.1.1.1 2>/dev/null | awk '{print $7}' | head -1)
121
+ fi
109
122
  if [ -z "$IP" ]; then
110
123
  IP="(tidak terdeteksi — pastikan WiFi/data aktif)"
111
124
  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.11",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",