initial commit

This commit is contained in:
polygon 2024-09-28 14:59:45 +02:00
commit 957df058c5
3 changed files with 42 additions and 0 deletions

7
LICENSE Normal file
View file

@ -0,0 +1,7 @@
Copyright 2024 Ally Naumann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# schaffendoor
Super sophisticated access control system for the hackspace in aschaffenburg
(Okay, actually it's a single bash script)

32
open.sh Normal file
View file

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$USER" == "open" ]; then
echo "Connecting to space systems..."
echo "Linking to DDR Mondbasis..."
echo "Asking the party for permission to unlock door...."
echo "Waiting for Faxmodem..."
echo "chanelling the force"
echo "Opening door..."
PIN=17
elif [ "$USER" == "close" ]; then
echo "Connecting to space systems..."
echo "Linking to DDR Mondbasis..."
echo "Rickrolling folks on mondbasis..."
echo "Locating Messlatte..."
echo "Closing door..."
PIN=27
else
exit 1
fi
if [ ! -d /sys/class/gpio/gpio$PIN ]; then
echo $PIN > /sys/class/gpio/export
fi
echo "in" > /sys/class/gpio/gpio$PIN/direction
echo "out" > /sys/class/gpio/gpio$PIN/direction
echo "0" > /sys/class/gpio/gpio$PIN/value
sleep 1
echo "1" > /sys/class/gpio/gpio$PIN/value
echo $PIN > /sys/class/gpio/unexport