#!/bin/sh appdir=$1 function isTerminalRunning() { return=`osascript< ~/Library/Preferences/edu.washington.jdlarios.MacPine fi fi return } # main() isTerminalRunning if [ $? -ne 1 ]; then # Terminal isn't running. getNetID launchPine "in the front window" else # Terminal is running. Is Pine? isPineRunning if [ $? -ne 1 ]; then # Pine isn't running. getNetID launchPine else osascript <