termux-connecting 1.1.31 → 1.1.33

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,6 +138,20 @@ else
138
138
  fi
139
139
  fi
140
140
 
141
+ # wake lock — cegah Termux dimatikan saat layar mati
142
+ if command -v termux-wake-lock >/dev/null; then
143
+ termux-wake-lock sshd 2>/dev/null && info "Wake lock aktif — koneksi tetap terjaga saat layar mati"
144
+ fi
145
+
146
+ # battery optimization — matikan agar Termux tidak di-kill Android
147
+ if command -v termux-battery-status >/dev/null 2>&1; then
148
+ : # termux-api tersedia
149
+ else
150
+ echo " Matikan battery optimization untuk Termux di Pengaturan:"
151
+ echo " Setelan → Aplikasi → Termux → Baterai → Tidak dioptimalkan"
152
+ echo ""
153
+ fi
154
+
141
155
  # ─── 6. Informasi Koneksi ───
142
156
  title "5. Informasi Koneksi"
143
157
  USERNAME=$(whoami)
@@ -218,40 +232,62 @@ echo "----------------------------------------"
218
232
  info "Setup selesai!"
219
233
  echo ""
220
234
 
221
- # ─── Opsional: Cek Permission (hanya jika koneksi OK) ───
222
- if [ "$CONNECTION_OK" = "true" ] && [ "$AUTO" = "false" ] && confirm "Cek permission tambahan (storage, auto-start sshd)" "n"; then
223
- echo ""
224
- title "Status Permission & Fitur"
225
-
226
- HAS_STORAGE="no"; HAS_BOOT="no"
227
-
228
- [ -d "$HOME/storage" ] && HAS_STORAGE="yes"
229
- [ -f "$HOME/.termux/boot/boot-sshd" ] && HAS_BOOT="yes"
230
-
231
- echo " ┌─────────────────────────────────────────────┐"
232
- [ "$HAS_STORAGE" = "yes" ] && echo " │ ✅ Storage — akses penyimpanan │" \
233
- || echo " │ ❌ Storage — akses penyimpanan │"
234
- [ "$HAS_BOOT" = "yes" ] && echo " │ ✅ Termux:Boot — auto-start sshd │" \
235
- || echo " │ ❌ Termux:Boot — auto-start sshd │"
236
- echo " └─────────────────────────────────────────────┘"
237
- echo ""
238
-
239
- if [ "$HAS_STORAGE" = "no" ] && confirm " Setup storage permission" "y"; then
240
- termux-setup-storage
241
- echo " Izininkan pop-up permission di Android"
235
+ # ─── Menu setelah setup ───
236
+ if [ "$AUTO" = "false" ]; then
237
+ while true; do
242
238
  echo ""
243
- fi
244
-
245
- if [ "$HAS_BOOT" = "no" ] && confirm " Setup auto-start sshd (Termux:Boot)" "y"; then
246
- mkdir -p "$HOME/.termux/boot"
247
- echo 'sshd' > "$HOME/.termux/boot/boot-sshd"
248
- chmod +x "$HOME/.termux/boot/boot-sshd"
249
- info "Boot script: ~/.termux/boot/boot-sshd"
250
- echo " Install aplikasi Termux:Boot dari F-Droid:"
251
- echo " https://f-droid.org/packages/com.termux.boot/"
252
- echo " Reboot HP agar sshd jalan otomatis"
239
+ echo " 1) Selesai"
240
+ echo " 2) Matikan SSH server (sshd)"
241
+ echo " 3) Status SSH server"
242
+ echo " 4) Tampilkan ulang info koneksi"
243
+ echo " 5) Cek permission & fitur"
253
244
  echo ""
254
- fi
255
-
256
- info "Permission & fitur selesai dicek"
245
+ echo -n " Pilih [1]: "
246
+ read -r post_choice
247
+ echo ""
248
+ case "$post_choice" in
249
+ 2)
250
+ if pgrep -x sshd >/dev/null; then
251
+ pkill sshd && info "sshd dimatikan"
252
+ else
253
+ warn "sshd sedang tidak berjalan"
254
+ fi
255
+ ;;
256
+ 3)
257
+ if pgrep -x sshd >/dev/null; then
258
+ info "sshd sedang berjalan (PID: $(pgrep -x sshd))"
259
+ else
260
+ warn "sshd tidak berjalan. Jalankan: sshd"
261
+ fi
262
+ ;;
263
+ 4)
264
+ echo " Username : $USERNAME"
265
+ echo " IP : ${IP:-tidak terdeteksi}"
266
+ echo " Port : 8022"
267
+ echo ""
268
+ echo " Di PC: termux-connect-pc connection"
269
+ ;;
270
+ 5)
271
+ # reuse permission check block
272
+ HAS_STORAGE="no"; HAS_BOOT="no"; HAS_WAKE="no"
273
+ [ -d "$HOME/storage" ] && HAS_STORAGE="yes"
274
+ [ -f "$HOME/.termux/boot/boot-sshd" ] && HAS_BOOT="yes"
275
+ command -v termux-wake-lock >/dev/null 2>&1 && HAS_WAKE="yes"
276
+ title "Status Permission & Fitur"
277
+ echo " ┌─────────────────────────────────────────────┐"
278
+ [ "$HAS_STORAGE" = "yes" ] && echo " │ ✅ Storage — akses penyimpanan │" || echo " │ ❌ Storage — akses penyimpanan │"
279
+ [ "$HAS_BOOT" = "yes" ] && echo " │ ✅ Termux:Boot — auto-start sshd │" || echo " │ ❌ Termux:Boot — auto-start sshd │"
280
+ [ "$HAS_WAKE" = "yes" ] && echo " │ ✅ Wake lock — koneksi tetap saat mati layar │" || echo " │ ❌ Wake lock — koneksi tetap saat mati layar │"
281
+ echo " └─────────────────────────────────────────────┘"
282
+ echo ""
283
+ if [ "$HAS_STORAGE" = "no" ] && confirm " Setup storage permission" "y"; then termux-setup-storage; echo " Izininkan pop-up permission di Android"; echo ""; fi
284
+ if [ "$HAS_WAKE" = "no" ] && confirm " Install wake lock (termux-api)" "y"; then pkg install -y termux-api; echo " Install aplikasi Termux:API dari F-Droid:"; echo " https://f-droid.org/packages/com.termux.api/"; echo ""; fi
285
+ if [ "$HAS_BOOT" = "no" ] && confirm " Setup auto-start sshd (Termux:Boot)" "y"; then mkdir -p "$HOME/.termux/boot"; echo 'sshd' > "$HOME/.termux/boot/boot-sshd"; chmod +x "$HOME/.termux/boot/boot-sshd"; info "Boot script: ~/.termux/boot/boot-sshd"; echo " https://f-droid.org/packages/com.termux.boot/"; echo " Reboot HP agar sshd jalan otomatis"; echo ""; fi
286
+ [ "$HAS_WAKE" = "yes" ] && termux-wake-lock sshd 2>/dev/null && info "Wake lock aktif"
287
+ ;;
288
+ *) break ;;
289
+ esac
290
+ done
291
+ echo ""
292
+ info "Sampai jumpa!"
257
293
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",