#! /usr/bin/env bash # blooper.command # Launch applications and reboot the machine # @author Filipp Lepalaan # @author Vesa Viskari # @copyright No (c), Public Domain software MYDIR="~/Desktop/BlooperApps" # Check if Login Item is set defaults read com.apple.loginitems | grep -c "Path: $($0)" if [[ ! -d "$MYDIR" ]]; then mkdir "$MYDIR" ln -s /Applications/Utilities/Grapher.app "$MYDIR/Grapher.app" ln -s /Applications/Utilities/Activity\ Monitor.app "$MYDIR/Activity Monitor.app" ln -s /Applications/Utilities/Console.app "$MYDIR/Console.app" ln -s /Applications/iTunes.app "$MYDIR/iTunes.app" fi find "$MYDIR/" -exec open {} \; trap "killall yes; rm ${MYDIR}; echo 'Cleaning up...'; exit 255" SIGINT sleep 10 # Time how long it took to boot up #... echo $(date) >> ~/Desktop/blooper.log #reboot osascript -e 'tell application "Finder" to restart'