diff --git a/lock b/lock index 66d2537..5d7bbf2 100755 --- a/lock +++ b/lock @@ -2,12 +2,7 @@ . $(dirname $(readlink "$0"))/shared echo "Initializing Space Systems..." -echo "22" > /sys/class/gpio/unexport -echo "22" > /sys/class/gpio/export -sleep 0.5 echo "Securing Communication to Space Systems..." -echo "out" > /sys/class/gpio/gpio22/direction -sleep 0.5 echo "Open Communication Channel..." # Silent, Output to /dev/null, Timeout after 5s and retry 12 times, each doubling the waitingtime until ten minutes. nohup curl -s -o /dev/null -m 5 --connect-timeout 5 --retry 12 "https://hamburg.ccc.de/dooris/status.php?apikey=${password}&action=close" >/dev/null 2>&1 & diff --git a/setup b/setup new file mode 100755 index 0000000..3d2c579 --- /dev/null +++ b/setup @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Setting up gpio: unlock" +echo "27" > /sys/class/gpio/unexport +echo "27" > /sys/class/gpio/export +echo "out" > /sys/class/gpio/gpio27/direction +chown -R root:gpio /sys/class/gpio/gpio27/* +chmod g+w /sys/class/gpio/gpio27/* + +echo "Setting up gpio: lock" +echo "27" > /sys/class/gpio/unexport +echo "22" > /sys/class/gpio/unexport +echo "22" > /sys/class/gpio/export +echo "out" > /sys/class/gpio/gpio22/direction +chown -R root:gpio /sys/class/gpio/gpio22/* +chmod g+w /sys/class/gpio/gpio22/* diff --git a/unlock b/unlock index b5def6d..59177fc 100755 --- a/unlock +++ b/unlock @@ -2,12 +2,7 @@ . $(dirname $(readlink "$0"))/shared echo "Initializing Space Systems..." -echo "27" > /sys/class/gpio/unexport -echo "27" > /sys/class/gpio/export -sleep 0.5 echo "Securing Communication to Space Systems..." -echo "out" > /sys/class/gpio/gpio27/direction -sleep 0.5 echo "Open Communication Channel..." nohup curl -s -o /dev/null -m 5 --connect-timeout 5 --retry 12 "https://hamburg.ccc.de/dooris/status.php?apikey=${password}&action=open" >/dev/null 2>&1 & echo "Unlocking Space..."