dmxStart.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. LA_DIR="${HOME}/Library/LaunchAgents"
  3. if [ ! -d "${LA_DIR}" ]; then
  4. echo "Invalid LaunchAgents directory: ${LA_DIR}" 1>&2
  5. exit 1
  6. fi
  7. cd $LA_DIR
  8. BIN="${HOME}/bin/video/dmx/dmxLauncher.sh"
  9. if [ ! -x "${BIN}" ]; then
  10. echo "Invalid binary: ${BIN}" 1>&2
  11. exit 2
  12. fi
  13. # Unload the jerky version
  14. launchctl unload com.uberzach.ola.dmx.plist
  15. # Unload all deps, which will automatially stop when OLA does
  16. for i in com.uberzach.ola.*.plist; do
  17. if [ "${i}" == "com.uberzach.ola.plist" ]; then
  18. continue
  19. elif [ "${i}" == "com.uberzach.ola.dmx.plist" ]; then
  20. continue
  21. elif [ "${i}" == "com.uberzach.ola.rave.plist" ]; then
  22. continue
  23. fi
  24. launchctl unload "${i}"
  25. done
  26. # Launch the non-jerky version
  27. ${HOME}/bin/video/dmx/dmxLauncher.sh &
  28. sleep 2
  29. # Reload all the deps
  30. for i in com.uberzach.ola.*.plist; do
  31. if [ "${i}" == "com.uberzach.ola.plist" ]; then
  32. continue
  33. elif [ "${i}" == "com.uberzach.ola.dmx.plist" ]; then
  34. continue
  35. elif [ "${i}" == "com.uberzach.ola.rave.plist" ]; then
  36. continue
  37. fi
  38. launchctl load "${i}"
  39. done
  40. launchctl list | grep uberzach
  41. echo
  42. echo "launchctl list | grep uberzach"
  43. exit 0