View Single Post
Old 02-06-2025, 07:56 AM   #8
remlap
Connoisseur
remlap began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Jun 2010
Device: none
Quote:
Originally Posted by AsherMaximum View Post
There's an example of how to show the IP address in the doc file that comes with the install, just switch out the toast line for that one.
I am learning as I go, I am a noob when it comes to bash commands and kobo.

Code:
#
## FTP Toggle
menu_item : main    : FTP Start : cmd_output          : 500:quiet :/usr/bin/pkill -f "^/usr/bin/tcpsvd -E 0.0.0.0 1021"
  chain_success:skip:11
    chain_failure                      : cmd_spawn           : quiet :exec /usr/bin/tcpsvd -E 0.0.0.0 1021 /usr/sbin/ftpd -w -t 30 /mnt/onboard
      chain_success:skip:2
      chain_failure                    : dbg_toast           : Error starting FTP server
        chain_success:skip:-1
    chain_success                      : cmd_output          : 500:quiet :grep -x 'ForceWifiOn=true' '/mnt/onboard/.kobo/Kobo/Kobo eReader.conf'
      chain_failure                    : nickel_setting      : enable : force_wifi
    chain_success                      : nickel_wifi         : enable
    chain_success                      : nickel_wifi         : autoconnect_silent
    chain_success                      : cmd_output          : 500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}' | sed 's/$/:1021/' | sed 's/^/Started FTP server on /'
    chain_success                      : cmd_spawn           : quiet :sed -i '/^## FTP Toggle/ { n; s/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1 FTP Stop \2/ }' /mnt/onboard/.adds/nm/menu
    chain_always:skip:-1
  chain_success                        : dbg_toast           : Stopped FTP server
    chain_success                      : cmd_spawn           : quiet :sed -i '/^## FTP Toggle/ { n; s/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1 FTP Start \2/ }' /mnt/onboard/.adds/nm/menu
    chain_success                      : cmd_output          : 500:quiet :/usr/bin/pgrep -f "^/usr/bin/tcpsvd -E 0.0.0.0 2023"
      chain_failure                    : nickel_setting      : disable : force_wifi

#
This works but not when wifi is disabled is there anyway to wait before wifi to connect before it runs

Code:
chain_success                      : cmd_output          : 500:/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}' | sed 's/$/:1021/' | sed 's/^/Started FTP server on /'
I think I will just leave my wifi always enabled

Last edited by remlap; 02-06-2025 at 08:07 AM.
remlap is offline   Reply With Quote