You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ "$http_status"-lt 200 ] || [ "$http_status"-ge 300 ]
80
+
then
81
+
# Log an error
82
+
log "Awake Webhook: Failed to send command \"nudge\". Check if your KEEP_AWAKE_WEBHOOK_URL is set correctly. If it is, check the service receiving webhooks for logs."
83
+
fi
64
84
fi
65
85
66
86
sleep 300
@@ -160,6 +180,25 @@ else
160
180
else
161
181
log "Tesla BLE: Failed to set Sentry Mode."
162
182
fi
183
+
elif [[ -n"${KEEP_AWAKE_WEBHOOK_URL:+x}" ]]
184
+
# Use webhook to send start command
185
+
then
186
+
http_response=$(curl -s -w "%{http_code}" POST \
187
+
-d "{\"awake_command\":\"start\"}" \
188
+
-H "Content-Type: application/json" \
189
+
"$KEEP_AWAKE_WEBHOOK_URL")
190
+
191
+
log "Awake Webhook: Command sent \"start\""
192
+
193
+
# Extract HTTP status code
194
+
http_status="${http_response: -3}"
195
+
196
+
# Check if HTTP status code is not 200 (OK)
197
+
if [ "$http_status"-lt 200 ] || [ "$http_status"-ge 300 ]
198
+
then
199
+
# Log an error
200
+
log "Awake Webhook: Failed to send command \"start\". Check if your KEEP_AWAKE_WEBHOOK_URL is set correctly. If it is, check the service receiving webhooks for logs."
if [ "$http_status"-lt 200 ] || [ "$http_status"-ge 300 ]
113
+
then
114
+
# Log an error
115
+
log "Awake Webhook: Failed to send command \"stop\". Check if your KEEP_AWAKE_WEBHOOK_URL is set correctly. If it is, check the service receiving webhooks for logs."
0 commit comments