Skip to content

Instantly share code, notes, and snippets.

@threepistons
Created January 5, 2018 11:41
Show Gist options
  • Save threepistons/eac72a3f57f7ba2ac73e7c65a70aa76f to your computer and use it in GitHub Desktop.
Save threepistons/eac72a3f57f7ba2ac73e7c65a70aa76f to your computer and use it in GitHub Desktop.
unsudoing scratchgpio
#!/bin/bash
#Version 0.2 - add in & to allow simultaneous running of handler and Scratch
#Version 0.3 - change sp launches rsc.sb from "/home/pi/Documents/Scratch Projects"
#Version 0.4 - 20Mar13 meltwater - change to use provided name for home
#Version 1.0 - 29Oct13 sw - change to cd into simplesi_scratch_handler to run servods OK
## This may not be enough without sudo.
pkill -f scratchgpio_handler
cd /scratchgpio8
python scratchgpio_handler8.py 127.0.0.1 standard &
## Give the new gpio handler five seconds to get started fully.
sleep 5
## The double ampersand and all that follows it pkills the user's scratchgpio_handler after Scratch exits.
scratch --document "/home/pi/Documents/Scratch Projects/rsc.sb" && pkill -f scratchgpio_handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment