Files
weval-l99/wevia-blade-relay.sh
2026-04-13 12:43:21 +02:00

18 lines
647 B
Bash
Executable File

#!/bin/bash
# WEVIA Blade Token Relay — runs */10, checks if Blade online, runs token renewal
BLADE="10.1.0.4"
LOG="/var/log/wevia-blade-relay.log"
# Check if Blade is online
if timeout 2 ping -c 1 $BLADE >/dev/null 2>&1; then
# Check if Chrome remote debug is available
if timeout 3 curl -sf http://$BLADE:9222/json/version >/dev/null 2>&1; then
echo "$(date +%H:%M): Blade online + Chrome active" >> $LOG
# Run token renewal via Blade's Chrome
python3 /opt/weval-l99/wevia-blade-renew.py >> $LOG 2>&1
else
echo "$(date +%H:%M): Blade online but Chrome not in debug mode" >> $LOG
fi
fi