#!/bin/bash function shutdown() { cd /Users/beamer/Documents/ProPresenter-LIVE /usr/bin/git add --all . /usr/bin/git commit -m "shutdown: commit" /usr/bin/git push origin exit 0 } function startup() { cd /Users/beamer/Documents/ProPresenter-LIVE rm -f .git/index.lock # if there was a dying git process during the last shutdown or crash /usr/bin/git add --all . /usr/bin/git commit -m "boot: inital commit" /usr/bin/git push origin tail -f /dev/null & wait $! } trap shutdown SIGTERM trap shutdown SIGKILL startup;