Process Watcher

A method for installed playback systems. Set as a login item for macOS. Adjust the target process and launch file as necessary. The watcher script will check that the defined process exists. If not, it will relaunch the target file. Based on the work of Jim Bell for Generativity by Fernanda D’Agostino, Suyama Space, Seattle WA, 2016.

#!/bin/bash

 
# @file: izzyWatcher.sh
 
# @author: Brendan Hogan

# @language: bash shell
 
# @version: 1.3.2
 
# @update: 2018-08-28



# Description:

 
# This script launches an Isadora patch, then runs a watcher loop.
 
# It checks every 10 seconds that the process 'Isadora' exists. 

# If it does not, the script will re-open the target patch and 
# continue the loop.


# Based on Jim Bell's script for Generativity by
# Fernanda D'Agostino,
 Suyama Space, Seattle WA, 2016 


#
# Print some information to the terminal explaining how this works:
 
clear 

sleep 1 

echo "-----------------------------------------------------------"
 
echo " ISADORA WATCHER "
 
echo " Launch an Isadora patch and verify that process exists."
echo " Restart Isadora if it crashes." 
echo " Sleeping for 10 seconds to let boot processes to complete."
 
echo "------------------------------------------------------------"
sleep 10
 
echo "" 
echo "-----------------------------------------------------------"
 
echo " Launching Isadora patch and beginning watcher loop." 
echo "-----------------------------------------------------------" 
echo ""


 
# Define target file path as appropriate. 

#
/usr/bin/open /Path/to/your/izzyPatch.izz

 # <- set file pathway here
#
# Verify that the patch file launches. 

until [ 0 = 1 ]

 
# WATCHER main loop: 

do

usr/bin/killall -0 Isadora # Identify application by process name.
if [ $? = 0 ]
then
echo "Isadora is active. Checking again in 10 seconds…"

else

echo "" 

echo "" 

echo "$(date): Error: Process not found - restarting Isadora." 

echo "" 

echo ""
/usr/bin/open /Path/to/your/izzyPatch.izz
sleep 10
 
done
Share:

Author: kreivalabs