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.
- package/bin/termux-connect-pc +1 -1
- package/bin/termux-connecting +14 -1
- package/package.json +1 -1
package/bin/termux-connect-pc
CHANGED
package/bin/termux-connecting
CHANGED
|
@@ -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
|