Add openclaw dropshell template for personal AI assistant
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 14s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 14s
This commit is contained in:
35
openclaw/restore.sh
Executable file
35
openclaw/restore.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/_volumes.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "DATA_PATH"
|
||||
|
||||
# Export variables for docker compose
|
||||
export CONTAINER_NAME DATA_PATH GATEWAY_PORT
|
||||
export IMAGE_REGISTRY IMAGE_REPO IMAGE_TAG
|
||||
export ANTHROPIC_API_KEY OPENROUTER_API_KEY
|
||||
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Stop and remove containers before restore
|
||||
docker compose -p "${CONTAINER_NAME}" down
|
||||
|
||||
# Restore files using dropshell's restore system
|
||||
# shellcheck disable=SC2046
|
||||
restore_items $(get_openclaw_volumes) || _die "Failed to restore data from backup file"
|
||||
|
||||
# Fix ownership after restore
|
||||
chown -R 1000:1000 "${DATA_PATH}"
|
||||
|
||||
# Start containers
|
||||
docker compose -p "${CONTAINER_NAME}" up -d
|
||||
|
||||
echo "Restore complete! Service is running."
|
||||
echo ""
|
||||
echo "Your gateway token:"
|
||||
if [ -f "${DATA_PATH}/gateway.token" ]; then
|
||||
cat "${DATA_PATH}/gateway.token"
|
||||
echo ""
|
||||
else
|
||||
echo " (check ${DATA_PATH}/config/openclaw.json)"
|
||||
fi
|
||||
Reference in New Issue
Block a user