View Single Post
Old 05-25-2006, 10:48 PM
dnanian's Avatar
dnanian dnanian is offline
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,376
Send a message via AIM to dnanian
This isn't a really easy thing to do, but given fixed paths, you could do something like:

#! /bin/sh
if [ -a /Volumes/A/System/Library/CoreServices/BootX ]; then
   UCHGSET=$(ls -lo /Volumes/A/System/Library/CoreServices/BootX | grep -vqF uchg; echo $?);
   chflags nouchg /Volumes/A/System/Library/CoreServices/BootX;
   bless -folder /Volumes/A/System/Library/CoreServices -save9 -label A -setBoot;

   if [ $UCHGSET -eq 1 ]; then
      chflags uchg /Volumes/A/System/Library/CoreServices/BootX;

   echo "Successfully set A as startup disk";
   echo "Could not set A as the startup disk because it does not contain a valid Mac OS X System Folder.";
   exit 1;

nohup /bin/bash -c "sleep 10; /Applications/SuperDuper!.app/Contents/Resources/Scripts/restart.scpt"&
--Dave Nanian
Reply With Quote