How to display text in Cydia console after package install?

Discussion in 'iOS Development' started by chickenmatt5, Apr 12, 2012.

  1. chickenmatt5 Community Development Team

    Member Since:
    Aug 3, 2010
    Message Count:
    3,436
    Device:
    iPhone 4S (Black)
    Maybe I shouldn't try with iFunBox's SSH terminal.
  2. C0C0 Well-Known Member

    Member Since:
    Jul 14, 2009
    Message Count:
    3,010
    Device:
    Samsung Galaxy Nexus
    I made it in iFile, and packaged it into a .deb with Mobile Terminal, if that matters.
    It shouldn't though. :p
  3. chickenmatt5 Community Development Team

    Member Since:
    Aug 3, 2010
    Message Count:
    3,436
    Device:
    iPhone 4S (Black)
    Finally got it working. What's the file to be named if I want it executed after EVERYTHING has been said in Cydia? "postinst" just does it after the package has been installed, so it inserts my text then another few lines of "Configuring package." I want my text to appear LAST.

    This is pretty relevant: http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
  4. C0C0 Well-Known Member

    Member Since:
    Jul 14, 2009
    Message Count:
    3,010
    Device:
    Samsung Galaxy Nexus
    I have no clue about that, sorry, but out of curiosity, what was wrong that made it fail?
  5. chickenmatt5 Community Development Team

    Member Since:
    Aug 3, 2010
    Message Count:
    3,436
    Device:
    iPhone 4S (Black)
    I'm not sure, I retyped the entire thing. Could have been that I didn't leave a blank line at the end. I also found an example of a postinst file that began with #!/bin/bash instead of #!/bin/sh so I used that.

    Also, I figured out how to move the custom text down. Where there would normally be Cydia text lines, put echo " " in the file. So, if Cydia normally does
    Code:
    Installed package.deb
    Custom text!
    Configuring package.deb
    Configured package.deb
    then you add 2 lines of echo " " before echo "Custom text!" then it turns out like
    Code:
    Installed package.deb
    Configuring package.deb
    Configured package.deb
    Custom text!
  6. C0C0 Well-Known Member

    Member Since:
    Jul 14, 2009
    Message Count:
    3,010
    Device:
    Samsung Galaxy Nexus
    Oh. Well, it works, that's the important part.
    Re-oh. I didn't know that.
  7. Bee Click New Member

    Member Since:
    Jul 21, 2012
    Message Count:
    1
    Device:
    iPhone 4S (White)
    I've tried that too:


    Code:
    #!/bin/sh
     
    echo "Thanks for installing!"
     
    exit 0

    But i got error "subprocess post-installation script returned error exit status 2"

    Please help. Thanks you.