Skip to content

Instantly share code, notes, and snippets.

@npryce
Created July 17, 2014 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npryce/c8d7defedd37e38cbb05 to your computer and use it in GitHub Desktop.
Save npryce/c8d7defedd37e38cbb05 to your computer and use it in GitHub Desktop.
Script to unexport all gpio device directories that are exported to userspace
#!/bin/bash
set -e
for f in $(find /sys/class/gpio/ -name 'gpio[0-9]*')
do
echo $(basename $f | cut -c 5-) | tee /sys/class/gpio/unexport
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment