Results 1 to 2 of 2
Discuss Automate bless with a .sh-file? on aTV.. at the AppleTV 1 - Hackint0sh.org; I want to make a small "script" that I can open with terminal (or iTerm) ...
  1. #1
    Senior Professional Array

    Join Date
    Mar 2007
    Posts
    261
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    21

    Default Automate bless with a .sh-file? on aTV..

    I want to make a small "script" that I can open with terminal (or iTerm) on aTV.
    The script should to this:
    - Bless OSX-boot.efi, but next-only (so that I only have to restart to get back to aTV)
    - Reboot (hopefully into OSX)

    The bless-command requires sudo, but then I have to put in the "frontrow"-password, how can I do this without putting in any password?

    And how should I set up the script?

    The command is:
    Code:
    sudo bless --folder=/mnt/System/Library/CoreServices --file=/mnt/System/Library/CoreServices/boot.efi --setBoot --nextonly
    
    sudo reboot



  2. #2
    Rookie Array

    Join Date
    Feb 2007
    Posts
    20
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Embedding a password (especially a root password) would be a very bad thing and as such most (all?) unix based OSes don't / won't allow for it.

    So how do you do what can't be done...

    Here's one way that I can think of...

    1 - become root (su)
    2 - Create script that 'watches' a specific folder for the existence of a file (empty file) with the name blessit.

    so it would look something like this (this is not exactly 'shell script code' but it does explain the process) the correct syntax will depend on what shell you choose to use...

    Code:
    watchForBless.sh
    --------------------------
    do 
        while 0 
        if ( -f /Users/frontrow/watch/blessit )
            rm  /Users/frontrow/watch/blessit file (so it doesn't keep doing this)
            - issue the bless command
            - issue the reboot command
        fi
        sleep 10
    done 
    --------------------------
    3 - Have the above script run at startup (as root)

    Now once you get this going all you need do is issue the following command (no root needed)

    touch /Users/frontrow/watch/blessit

    That command simply creates a blank file that the script (above) running as root will then see and be triggered to do it's job.

    Good luck

    Dave
    Last edited by DaveGee; 04-28-2007 at 10:08 PM.

 

 

Similar Threads

  1. MacNN: Zevrix offers tools to automate Office PDF creation
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 03-07-2011, 04:30 AM
  2. MacNN: Foxconn may ask for device price hikes, automate work
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 06-08-2010, 02:30 PM
  3. Replies: 0
    Last Post: 03-17-2010, 07:40 PM
  4. Script to automate signing in for wi-fi
    By priggy in forum iPod Touch 1G
    Replies: 3
    Last Post: 10-21-2007, 09:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 04:23 PM.
twitter, follow us!