Restart Mac Classic from a script

I’ve been asked this a couple of times, so I’m revisiting this topic (see post 50). I didn’t think it would have been too common for people to want to restart classic from a script, but apparently there are some. If this doesn’t interest you, at least you might want to take a peek at this. You can use the same principles to kill and start other processes that may have hung in your scripts.

If you remember, back when OS X was in it’s infancy, it was dubbed Rhapsody. And they talked about the possiblitly of having Mac Classic run in a blue box and Windows run in a yellow box, and I don’t recall if OS X had a box, but it was like the native system. Well, Apple did carry out the blue box and Classic does run in the blue box as intended. So what you need to do to kill classic is find it’s process using ps, then pipe that information into a kill command.

TruBlueState=$(ps -auxwww | grep TruBlueEnvironment | grep -v grep | awk ‘{print $2}’)
echo $TruBlueState;

kill -9 $TruBlueState

open ‘/System/Library/CoreServices/Classic Startup.app’

After pulling the pid into TruBlueState you then run a kill on it. Make sure your grep is TruBlue and not TrueBlue. There is no e in TruBlueEnvironment.

The next step is to open the Classic Startup.app in the CoreServices folder of your System Library. That will restart classic after it has been killed.

Comments are closed.