DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: Hidden Shutdown Options - How do they work?

  1. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #21
    I just verified that this works with the stock shell. This script disables JUST the power+camera shortcut, but keeps the power+volume shortcuts working.

    To install:
    Code:
    su
    sysrw
    cp /sdcard/shutdown.txt /system/bin/shutdown
    chmod 0755 /system/bin/shutdown
    Attached Files
    Last edited by Se7enLC; 06-18-2010 at 08:46 AM.
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  2. Master Droid
    michael_campbell's Avatar
    Member #
    63778
    Join Date
    Apr 2010
    Location
    Atlanta suburbia.
    Posts
    328
    Phone
    Moto Droid 1.
    #22

    sh syntax

    Just a nit by an OCD old shell hack here, Se7enLC. You don't need the trailing ";" on an if statement if your "then" is on the next line. They're only needed if you have the "then" on the SAME line, in order that the shell treat it as a separate statement. The newline accomplishes the same thing.

    Code:
    if [ condition ]; then ...
    or

    Code:
    if [ condition ]
    then ...
    The added ";" causes no harm of course.

    Same with the "for ... do" statements, and statements on their own line of course need no ";". I do it all the time too as habit from C and Java programming.
  3. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #23
    Quote Originally Posted by michael_campbell View Post
    Just a nit by an OCD old shell hack here, Se7enLC. You don't need the trailing ";" on an if statement if your "then" is on the next line. They're only needed if you have the "then" on the SAME line, in order that the shell treat it as a separate statement. The newline accomplishes the same thing.

    Code:
    if [ condition ]; then ...
    or

    Code:
    if [ condition ]
    then ...
    The added ";" causes no harm of course.

    Same with the "for ... do" statements, and statements on their own line of course need no ";". I do it all the time too as habit from C and Java programming.
    Blame Pete for that one - I usually keep my "then" on the same line - I just tried to keep with the same style as the existing shutdown script I pulled out of the update.zip for BB 0.2. It's got semicolons all over the place!
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  4. Master Droid
    michael_campbell's Avatar
    Member #
    63778
    Join Date
    Apr 2010
    Location
    Atlanta suburbia.
    Posts
    328
    Phone
    Moto Droid 1.
    #24
    Quote Originally Posted by Se7enLC View Post
    Blame Pete for that one - I usually keep my "then" on the same line - I just tried to keep with the same style as the existing shutdown script I pulled out of the update.zip for BB 0.2. It's got semicolons all over the place!
    *haha*, fair enough; I actually haven't looked at his original. But yeah, I do the same-line then also. Again, remnants of my background (and age)!
  5. Droid Ninja
    jaycemiskel's Avatar
    Member #
    74156
    Join Date
    Jun 2010
    Posts
    1,382
    Liked
    9 times
    Phone
    Galaxy Nexus
    #25
    Works great. Appreciate that. Because of the way I hold my phone I was shutting it down about 5 or 6 times a day.
  6. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #26
    Quote Originally Posted by Se7enLC View Post
    I just verified that this works with the stock shell. This script disables JUST the power+camera shortcut, but keeps the power+volume shortcuts working.

    To install:
    Code:
    su
    sysrw
    cp /sdcard/shutdown.txt /system/bin/shutdown
    chmod 0755 /system/bin/shutdown
    Works like a charm, thanks!
  7. Junior Droid
    crpngdth2001's Avatar
    Member #
    77745
    Join Date
    Jun 2010
    Location
    Delaware, Ohio
    Posts
    18
    Phone
    Motorola Droid
    #27

    Question

    Quote Originally Posted by Se7enLC View Post
    I just verified that this works with the stock shell. This script disables JUST the power+camera shortcut, but keeps the power+volume shortcuts working.

    To install:
    Code:
    su
    sysrw
    cp /sdcard/shutdown.txt /system/bin/shutdown
    chmod 0755 /system/bin/shutdown
    What would the difference be in modifying the shutdown script to eliminate one of the shortcuts, or changing/eliminating one of the commands that calls it? I'm just curious and still learning.

    For example, in init.sholes.rc you would see:

    #shutdown options by pete
    service poweroff /system/bin/shutdown
    disabled
    keycodes 107 211

    service reboot /system/bin/shutdown -r
    disabled
    keycodes 107 114

    service recovery /system/bin/shutdown -rr
    disabled
    keycodes 107 115

    Could I not comment one of these commands out (depending on which option I wanted to get rid of) if I did not want to modify the shutdown script?
  8. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #28

    Re: Hidden Shutdown Options - How do they work?

    Haha would've done that if I knew it was there! Ill change that now, thanks

    Sent from my Droid using Tapatalk
  9. Senior Droid
    creamers's Avatar
    Member #
    21128
    Join Date
    Dec 2009
    Location
    Tennessee
    Posts
    119
    Phone
    Pm me for it.
    #29

    Talking

    Quote Originally Posted by crpngdth2001 View Post
    Quote Originally Posted by Se7enLC View Post
    I just verified that this works with the stock shell. This script disables JUST the power+camera shortcut, but keeps the power+volume shortcuts working.

    To install:
    Code:
     su
     sysrw
     cp /sdcard/shutdown.txt /system/bin/shutdown
     chmod 0755 /system/bin/shutdown
    What would the difference be in modifying the shutdown script to eliminate one of the shortcuts, or changing/eliminating one of the commands that calls it? I'm just curious and still learning.

    For example, in init.sholes.rc you would see:

    #shutdown options by pete
    service poweroff /system/bin/shutdown
    disabled
    keycodes 107 211

    service reboot /system/bin/shutdown -r
    disabled
    keycodes 107 114

    service recovery /system/bin/shutdown -rr
    disabled
    keycodes 107 115

    Could I not comment one of these commands out (depending on which option I wanted to get rid of) if I did not want to modify the shutdown script?

    Never would have figured that out and that is so smart to do.
  10. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #30
    LOOOOL

    I looked all over the place, but never thought to look in the ROOT DIRECTORY!

    Crap - looking through that file, I see that there are hardcoded frequency settings in there. Looks like I'm going to have to look into modding that file, too!

    Also - it looks like this is a pretty early init script, so I might be able to use this for allowing me to move dalvik-cache to the /cache partition successfully...
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
Page 3 of 4 FirstFirst 1234 LastLast

Links

Posting Permissions

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

Similar Threads

  1. hidden phone options none of us know anything about.
    By gixxerboy in forum Android General Discussions
    Replies: 5
    Last Post: 05-21-2010, 07:20 AM
  2. Bugless Beast 7.5 Random Shutdown
    By Aviamund in forum Android Hacks and Help
    Replies: 1
    Last Post: 02-15-2010, 06:25 PM
  3. Hidden
    By AJRAS in forum Android Hacks and Help
    Replies: 2
    Last Post: 02-14-2010, 08:19 PM
  4. Shutdown unnecessary apps
    By theproman23 in forum Motorola Droid
    Replies: 0
    Last Post: 02-14-2010, 05:27 PM
  5. 2 Problems need help, Camera and Shutdown
    By snowman in forum Android General Discussions
    Replies: 4
    Last Post: 01-11-2010, 07:46 PM

Search tags for this page

android command line shutdown
,
android halt command
,
android power off command
,

android reboot command

,

android shutdown command

,
android shutdown options
,

android shutdown script

,
droid x2 how to change shutdown
,
shutdown android command
,

shutdown command android

Click on a term to search our site for related topics.
Find us on Google+