mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 05:02:04 +03:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
# Run via cron or systemd timer to get proactive notifications
|
||||
# before Claude Code auth expires.
|
||||
#
|
||||
# Suggested cron: */30 * * * * /home/admin/clawdbot/scripts/auth-monitor.sh
|
||||
# Suggested cron: */30 * * * * /home/admin/moltbot/scripts/auth-monitor.sh
|
||||
#
|
||||
# Environment variables:
|
||||
# NOTIFY_PHONE - Phone number to send Clawdbot notification (e.g., +1234567890)
|
||||
# NOTIFY_NTFY - ntfy.sh topic for push notifications (e.g., clawdbot-alerts)
|
||||
# NOTIFY_PHONE - Phone number to send Moltbot notification (e.g., +1234567890)
|
||||
# NOTIFY_NTFY - ntfy.sh topic for push notifications (e.g., moltbot-alerts)
|
||||
# WARN_HOURS - Hours before expiry to warn (default: 2)
|
||||
|
||||
set -euo pipefail
|
||||
@@ -41,12 +41,12 @@ send_notification() {
|
||||
return
|
||||
fi
|
||||
|
||||
# Send via Clawdbot if phone configured and auth still valid
|
||||
# Send via Moltbot if phone configured and auth still valid
|
||||
if [ -n "$NOTIFY_PHONE" ]; then
|
||||
# Check if we can still use clawdbot
|
||||
# Check if we can still use moltbot
|
||||
if "$SCRIPT_DIR/claude-auth-status.sh" simple 2>/dev/null | grep -q "OK\|EXPIRING"; then
|
||||
echo "Sending via Clawdbot to $NOTIFY_PHONE..."
|
||||
clawdbot send --to "$NOTIFY_PHONE" --message "$message" 2>/dev/null || true
|
||||
echo "Sending via Moltbot to $NOTIFY_PHONE..."
|
||||
moltbot send --to "$NOTIFY_PHONE" --message "$message" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -54,7 +54,7 @@ send_notification() {
|
||||
if [ -n "$NOTIFY_NTFY" ]; then
|
||||
echo "Sending via ntfy.sh to $NOTIFY_NTFY..."
|
||||
curl -s -o /dev/null \
|
||||
-H "Title: Clawdbot Auth Alert" \
|
||||
-H "Title: Moltbot Auth Alert" \
|
||||
-H "Priority: $priority" \
|
||||
-H "Tags: warning,key" \
|
||||
-d "$message" \
|
||||
@@ -78,7 +78,7 @@ HOURS_LEFT=$((DIFF_MS / 3600000))
|
||||
MINS_LEFT=$(((DIFF_MS % 3600000) / 60000))
|
||||
|
||||
if [ "$DIFF_MS" -lt 0 ]; then
|
||||
send_notification "Claude Code auth EXPIRED! Clawdbot is down. Run: ssh l36 '~/clawdbot/scripts/mobile-reauth.sh'" "urgent"
|
||||
send_notification "Claude Code auth EXPIRED! Moltbot is down. Run: ssh l36 '~/moltbot/scripts/mobile-reauth.sh'" "urgent"
|
||||
exit 1
|
||||
elif [ "$HOURS_LEFT" -lt "$WARN_HOURS" ]; then
|
||||
send_notification "Claude Code auth expires in ${HOURS_LEFT}h ${MINS_LEFT}m. Consider re-auth soon." "high"
|
||||
|
||||
Reference in New Issue
Block a user