diff --git a/run_service.sh b/run_service.sh index cb91cfa6..486aeaf3 100755 --- a/run_service.sh +++ b/run_service.sh @@ -499,7 +499,7 @@ create_storage() { ' This folder contains crucial configuration information and autogenerated keys for your Trader agent.\n' \ ' Please back up this folder and be cautious if you are modifying or sharing these files to avoid potential asset loss.' > "../$store_readme_path" - dotenv_set_key "$env_file_path" "SUBGRAPH_API_KEY" "$SUBGRAPH_API_KEY" true + dotenv_set_key "../$env_file_path" "SUBGRAPH_API_KEY" "$SUBGRAPH_API_KEY" true dotenv_set_key "../$env_file_path" "USE_STAKING" "$USE_STAKING" AGENT_ID=14 @@ -1060,11 +1060,13 @@ fi # ensure Safe owner is agent # (This may occur if update flow was interrupted) -service_safe_address=$(<"../$service_safe_address_path") -current_safe_owners=$(poetry run python "../scripts/get_safe_owners.py" "$service_safe_address" "../$agent_pkey_path" "$rpc" $password_argument | awk '{gsub(/"/, "\047", $0); print $0}') -if [[ "$current_safe_owners" == "['$operator_address']" ]]; then - echo "[Operator] Swapping Safe owner..." - poetry run python "../scripts/swap_safe_owner.py" "$service_safe_address" "../$operator_pkey_path" "$agent_address" "$rpc" $password_argument +if [[ -f "../$service_safe_address_path" ]]; then + service_safe_address=$(<"../$service_safe_address_path") + current_safe_owners=$(poetry run python "../scripts/get_safe_owners.py" "$service_safe_address" "../$agent_pkey_path" "$rpc" $password_argument | awk '{gsub(/"/, "\047", $0); print $0}') + if [[ "$current_safe_owners" == "['$operator_address']" ]]; then + echo "[Operator] Swapping Safe owner..." + poetry run python "../scripts/swap_safe_owner.py" "$service_safe_address" "../$operator_pkey_path" "$agent_address" "$rpc" $password_argument + fi fi