termux-connecting 1.1.25 → 1.1.27

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.
@@ -138,8 +138,8 @@ else
138
138
  fi
139
139
  fi
140
140
 
141
- # ─── 7. Informasi Koneksi ───
142
- title "6. Informasi Koneksi"
141
+ # ─── 6. Informasi Koneksi ───
142
+ title "5. Informasi Koneksi"
143
143
  USERNAME=$(whoami)
144
144
 
145
145
  IP=""
@@ -186,8 +186,9 @@ if [ -n "$WIFI_SSID" ]; then
186
186
  fi
187
187
  echo ""
188
188
 
189
+ CONNECTION_OK=false
190
+
189
191
  if [ -z "$IP" ]; then
190
- warn "IP tidak terdeteksi"
191
192
  echo " Pastikan HP terhubung ke WiFi, bukan data seluler."
192
193
  echo ""
193
194
  echo " Langkah:"
@@ -204,6 +205,7 @@ elif is_cgnat "$IP"; then
204
205
  echo " 4. Jalankan ulang: termux-connecting -y"
205
206
  echo " 5. Atau cek IP manual: ip a | grep wlan"
206
207
  elif is_wifi "$IP"; then
208
+ CONNECTION_OK=true
207
209
  echo " Di PC/Mac, jalankan perintah berikut:"
208
210
  echo " npm i -g termux-connecting"
209
211
  echo " termux-connect-pc"
@@ -238,41 +240,41 @@ echo "----------------------------------------"
238
240
  info "Setup selesai!"
239
241
  echo ""
240
242
 
241
- # ─── Opsional: Cek Permission ───
242
- if confirm "Cek permission & fitur tambahan (WiFi SSID, storage, auto-start)" "n"; then
243
+ # ─── Opsional: Cek Permission (hanya jika koneksi OK) ───
244
+ if [ "$CONNECTION_OK" = "true" ] && [ "$AUTO" = "false" ] && confirm "Cek permission & fitur tambahan (WiFi SSID, storage, auto-start)" "n"; then
243
245
  echo ""
244
246
  title "Status Permission & Fitur"
245
247
 
246
- HAS_API=false; HAS_STORAGE=false; HAS_BOOT=false
248
+ HAS_API="no"; HAS_STORAGE="no"; HAS_BOOT="no"
247
249
 
248
- command -v termux-wifi-connectioninfo >/dev/null 2>&1 && HAS_API=true
249
- [ -d "$HOME/storage" ] && HAS_STORAGE=true
250
- [ -f "$HOME/.termux/boot/boot-sshd" ] && HAS_BOOT=true
250
+ command -v termux-wifi-connectioninfo >/dev/null 2>&1 && HAS_API="yes"
251
+ [ -d "$HOME/storage" ] && HAS_STORAGE="yes"
252
+ [ -f "$HOME/.termux/boot/boot-sshd" ] && HAS_BOOT="yes"
251
253
 
252
254
  echo " ┌─────────────────────────────────────────────┐"
253
- $HAS_API && echo " │ ✅ Termux:API — WiFi SSID │" \
254
- || echo " │ ❌ Termux:API — WiFi SSID │"
255
- $HAS_STORAGE && echo " │ ✅ Storage — akses penyimpanan │" \
256
- || echo " │ ❌ Storage — akses penyimpanan │"
257
- $HAS_BOOT && echo " │ ✅ Termux:Boot — auto-start sshd │" \
258
- || echo " │ ❌ Termux:Boot — auto-start sshd │"
255
+ [ "$HAS_API" = "yes" ] && echo " │ ✅ Termux:API — WiFi SSID │" \
256
+ || echo " │ ❌ Termux:API — WiFi SSID │"
257
+ [ "$HAS_STORAGE" = "yes" ] && echo " │ ✅ Storage — akses penyimpanan │" \
258
+ || echo " │ ❌ Storage — akses penyimpanan │"
259
+ [ "$HAS_BOOT" = "yes" ] && echo " │ ✅ Termux:Boot — auto-start sshd │" \
260
+ || echo " │ ❌ Termux:Boot — auto-start sshd │"
259
261
  echo " └─────────────────────────────────────────────┘"
260
262
  echo ""
261
263
 
262
- if ! $HAS_API && confirm " Install Termux:API (WiFi SSID)" "y"; then
264
+ if [ "$HAS_API" = "no" ] && confirm " Install Termux:API (WiFi SSID)" "y"; then
263
265
  pkg install -y termux-api
264
266
  echo " Install aplikasi Termux:API dari F-Droid:"
265
267
  echo " https://f-droid.org/packages/com.termux.api/"
266
268
  echo ""
267
269
  fi
268
270
 
269
- if ! $HAS_STORAGE && confirm " Setup storage permission" "y"; then
271
+ if [ "$HAS_STORAGE" = "no" ] && confirm " Setup storage permission" "y"; then
270
272
  termux-setup-storage
271
273
  echo " Izininkan pop-up permission di Android"
272
274
  echo ""
273
275
  fi
274
276
 
275
- if ! $HAS_BOOT && confirm " Setup auto-start sshd (Termux:Boot)" "y"; then
277
+ if [ "$HAS_BOOT" = "no" ] && confirm " Setup auto-start sshd (Termux:Boot)" "y"; then
276
278
  mkdir -p "$HOME/.termux/boot"
277
279
  echo 'sshd' > "$HOME/.termux/boot/boot-sshd"
278
280
  chmod +x "$HOME/.termux/boot/boot-sshd"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",