feat: report version, handle remote upgrade via update-clawd.sh

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-04-30 18:18:30 +08:00
parent 5a5c3ca4b5
commit b4e0388c71
2 changed files with 98 additions and 4 deletions

View File

@@ -5,6 +5,13 @@ REPO_DIR="/opt/clawd"
REMOTE="origin"
BRANCH="main"
SERVICE="clawd.service"
NO_RESTART=false
for arg in "$@"; do
case "$arg" in
--no-restart) NO_RESTART=true ;;
esac
done
echo "==> clawd update start"
date
@@ -41,13 +48,18 @@ else
echo "==> No dependency changes, skip npm install"
fi
echo "==> Current commit:"
git log --oneline -1
if [ "$NO_RESTART" = true ]; then
echo "==> --no-restart: skip systemctl restart (caller handles restart)"
exit 0
fi
echo "==> Restarting service: $SERVICE"
systemctl restart "$SERVICE"
echo "==> Service status:"
systemctl status "$SERVICE" --no-pager -l || true
echo "==> Current commit:"
git log --oneline -1
echo "==> clawd update done"