A Python based project which measures the light levels of an environment and forwards those measurements on to a server. This project is one of several which forms the software-side of the 'Return to Ritherdon' project.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
#!/bin/bas
logDate = $( date '+%Y-%m-%dT%TZ' )
logFile = "/home/lm-1/logs/shutdown-logs.txt"
getApiUrl ( ) {
# Copy and Paste for the win!
case $HOSTNAME in
( factory1) apiURL = "http://3.9.19.84/api/status/update/1" ; ;
( factory2) apiURL = "http://3.9.19.84/api/status/update/2" ; ;
( factory3) apiURL = "http://3.9.19.84/api/status/update/3" ; ;
( gallery1) apiURL = "http://3.9.19.84/api/status/update/4" ; ;
( gallery2) apiURL = "http://3.9.19.84/api/status/update/5" ; ;
( gallery3) apiURL = "http://3.9.19.84/api/status/update/6" ; ;
esac
}
logStatusChange ( ) {
cat << EOF >> $logFile
$logDate
EOF
}
logStatusChange
getApiUrl
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "off", "time": "' ${ logDate } '", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' " ${ apiURL } "
sleep 5
shutdown now