Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Here's my script so far: Code: #!/bin/bash cd /var/backups/System/ chmod 444 Themes.zip chown nobody:mobile Themes.zip exit 0 What I need is a if statement for the application Cydia kinda like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12

    Bash script help


    Here's my script so far:
    Code:
    #!/bin/bash
    
    cd /var/backups/System/
    chmod 444 Themes.zip
    chown nobody:mobile Themes.zip
    
    exit 0
    What I need is a if statement for the application Cydia kinda like this:
    Code:
    #!/bin/bash
    
    declare -a cydia
    cydia=($CYDIA)
    
    if [[ $! == remove ]]; then
    * * #FIXME: this may need to be changed when we have updates
    * * SpireRemover
    
    * * # force a reboot after uninstallation
    * * if [[ ${CYDIA+at symbol} ]]; then
    * * eval "echo 'finish:reboot' >&${cydia[0]}"
    
    * * fi
    fi
    
    exit 0
    But I want a finsih restart on install and uninstall if possible?
    Last edited by Death2020; 07-09-2012 at 05:20 AM.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    what will calling $CYDIA run/do?

    i'm pretty sure that your "$!" line will never equal 'remove'. The $! always returns the exit status of the last command run in Bash; a numerical value, usually 0 for success and 1 for failure. even if it did return some string, you'd want to encase the match string in quotes, e.g. == "remove"

    maybe the command is echoing something to the terminal?

    But I want a finsih restart on install and uninstall if possible?
    i don't understand what you are asking for here.
    Last edited by atreyu; 07-09-2012 at 12:19 AM. Reason: typo

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12
    I want a finish:restart like where it show echo finish:reboot I'm not good with scripts is why I came here and this script I got from another cydia package that requires a reboot

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Death2020 View Post
    I want a finish:restart like where it show echo finish:reboot I'm not good with scripts is why I came here and this script I got from another cydia package that requires a reboot
    i for one have no idea what finish:reboot and finish:restart mean, without providing more context.

    i'm fairly certain we can help you w/your problem, but we need more info first. You can start by answering these questions:

    What *exactly* do you want your script to do?

    What is CYDIA and what does it do, or how do you use/call it?

  5. #5
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12
    This cydia.saurik.com is Cydia and I want this
    Code:
    # force a reboot after uninstallation
    * * if [[ ${CYDIA+at symbol} ]]; then
    * * eval "echo 'finish:reboot' >&${cydia[0]}"
    to be a restart instead of a reboot.

  6. #6
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,286
    Hi.

    Some details for responders:
    Cydia is an alternative to Apple's App Store for "jailbroken" devices, at this time including iPhones, iPads, and iPod Touches, specializing in the distribution of all that is not an "app".

    Cydia is not available in Apple's App Store, nor is it a website: it is installed on your device using a "jailbreaking" tool, such as redsn0w or Absinthe.

    -- Cydia
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  7. #7
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12
    Thank you drl

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Death2020 View Post
    This cydia.saurik.com is Cydia and I want this
    Code:
    # force a reboot after uninstallation
    * * if [[ ${CYDIA+at symbol} ]]; then
    * * eval "echo 'finish:reboot' >&${cydia[0]}"
    to be a restart instead of a reboot.
    sorry, i still don't understand. it may be clear to you, but not to me. what do those asterisks mean? is that the actual code?

  9. #9
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12
    Quote Originally Posted by atreyu View Post
    sorry, i still don't understand. it may be clear to you, but not to me. what do those asterisks mean? is that the actual code?
    Yes it's the actual code and it's giving Cydia a command

  10. #10
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Death2020 View Post
    Yes it's the actual code and it's giving Cydia a command
    do you literally just want to change the text that says "reboot" to "restart"? or is it something deeper than that? If the former, can you not open this script in an editor (gedit, nedit, vi, etc.) and just change the "reboot" to "restart" and save it?

    look at this thread that talks about cydia for reference.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •