1
0
Fork 0
Browse Source

add times to startup and shutdown scripts.

pull/1/head
Craig Oates 4 years ago
parent
commit
5f264e7f60
  1. 5
      shutdown.sh
  2. 7
      startup.sh

5
shutdown.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bas
logDate=$(date '+%Y-%m-%dT%TZ')
logFile="/home/lm-1/logs/shutdown-logs.txt"
@ -26,4 +26,5 @@ getApiUrl
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "off", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}"
shutdown now
sleep 5
shutdown now

7
startup.sh

@ -1,5 +1,7 @@
#!/bin/bash
sleep 40
logDate=$(date '+%Y-%m-%dT%TZ')
logFile="/home/lm-1/logs/start-logs.txt"
@ -24,4 +26,7 @@ EOF
logStatusChange
getApiUrl
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "on", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}"
curl -S -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d '{"status": "on", "time": "'${logDate}'", "token": "QWERTYuiopasdfghjklzxcvbnm_1234567890"}' "${apiURL}"
sleep 10
sudo python /home/lm-1/repos/light-meter/cli_meter.py