Compare commits
No commits in common. "master" and "stable" have entirely different histories.
|
@ -1,3 +1,2 @@
|
||||||
password=sesamaenderdich
|
password=sesamaenderdich
|
||||||
spaceapi_password=mekmitasdigoat
|
|
||||||
tresor=1111
|
tresor=1111
|
||||||
|
|
1
lock
1
lock
|
@ -6,7 +6,6 @@ echo "Securing Communication to Space Systems..."
|
||||||
echo "Open Communication Channel..."
|
echo "Open Communication Channel..."
|
||||||
# Silent, Output to /dev/null, Timeout after 5s and retry 12 times, each doubling the waitingtime until ten minutes.
|
# 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 &
|
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 &
|
||||||
nohup curl -s -o /dev/null -m 5 --connect-timeout 5 --retry 12 -X PUT -d false -u dooris:${spaceapi_password} "https://spaceapi.hamburg.ccc.de/state/open" >/dev/null 2>&1 &
|
|
||||||
nohup mosquitto_pub -h 'mqtt.z9' -t 'z9/door/status' -r -m 'locked' >/dev/null 2>&1 &
|
nohup mosquitto_pub -h 'mqtt.z9' -t 'z9/door/status' -r -m 'locked' >/dev/null 2>&1 &
|
||||||
echo "Locking Space..."
|
echo "Locking Space..."
|
||||||
echo "1" > /sys/class/gpio/gpio22/value
|
echo "1" > /sys/class/gpio/gpio22/value
|
||||||
|
|
10
shared
10
shared
|
@ -8,19 +8,13 @@ if [ ! -f "${basedir}/${config}" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get password config value in a safe way
|
# get password config value in a safe way
|
||||||
password="$(grep '^password' ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
|
password="$(grep password ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
|
||||||
if [ -z "${password}" ]; then
|
if [ -z "${password}" ]; then
|
||||||
echo "WARNING: password in ${config} is missing!" >&2
|
echo "WARNING: password in ${config} is missing!" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get spaceapi-password config value in a safe way
|
|
||||||
spaceapi_password="$(grep '^spaceapi_password' ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
|
|
||||||
if [ -z "${spaceapi_password}" ]; then
|
|
||||||
echo "WARNING: spaceapi_password in ${config} is missing!" >&2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# get tresor config value in a safe way
|
# get tresor config value in a safe way
|
||||||
tresor="$(grep '^tresor' ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
|
tresor="$(grep tresor ${basedir}/${config} 2>/dev/null|cut -d= -f2|tr -d ' \t')"
|
||||||
if [ -z "${tresor}" ]; then
|
if [ -z "${tresor}" ]; then
|
||||||
echo "WARNING: tresor in ${config} is missing!" >&2
|
echo "WARNING: tresor in ${config} is missing!" >&2
|
||||||
fi
|
fi
|
||||||
|
|
1
unlock
1
unlock
|
@ -5,7 +5,6 @@ echo "Initializing Space Systems..."
|
||||||
echo "Securing Communication to Space Systems..."
|
echo "Securing Communication to Space Systems..."
|
||||||
echo "Open Communication Channel..."
|
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 &
|
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 &
|
||||||
nohup curl -s -o /dev/null -m 5 --connect-timeout 5 --retry 12 -X PUT -d true -u dooris:${spaceapi_password} "https://spaceapi.hamburg.ccc.de/state/open" >/dev/null 2>&1 &
|
|
||||||
nohup mosquitto_pub -h 'mqtt.z9' -t 'z9/door/status' -r -m 'unlocked' >/dev/null 2>&1 &
|
nohup mosquitto_pub -h 'mqtt.z9' -t 'z9/door/status' -r -m 'unlocked' >/dev/null 2>&1 &
|
||||||
echo "Unlocking Space..."
|
echo "Unlocking Space..."
|
||||||
echo "1" > /sys/class/gpio/gpio27/value
|
echo "1" > /sys/class/gpio/gpio27/value
|
||||||
|
|
Loading…
Reference in a new issue