Skip to content

Commit c14d314

Browse files
committed
refactor: replace exec_on_host with exec_on_host_simple in health.sh
- Updated the `start_storage_services` function to use `exec_on_host_simple` for executing commands on remote hosts, improving code consistency and readability. - Adjusted multiple command executions related to storage configuration and service startup to utilize the simplified execution method.
1 parent 4d4a9cc commit c14d314

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

scripts/ipc-subnet-manager/lib/health.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ start_storage_services() {
246246

247247
log_info "Preparing storage config on $name..."
248248
local init_cmd="$ipc_binary storage init --node-config $node_init_config"
249-
if ! exec_on_host "$idx" "$init_cmd >/dev/null 2>&1"; then
249+
if ! exec_on_host_simple "$idx" "$init_cmd >/dev/null 2>&1"; then
250250
log_error "Failed to generate storage config on $name"
251251
continue
252252
fi
@@ -276,21 +276,21 @@ start_storage_services() {
276276
local eth_api_port
277277
eth_api_port=$(get_validator_port "$idx" "eth_api" "$(get_config_value_with_default "network.eth_api_port" "8545")")
278278

279-
exec_on_host "$idx" "yq eval \".\\\"objects-listen-addr\\\" = \\\"$objects_listen_addr\\\"\" -i $storage_cfg_path"
280-
exec_on_host "$idx" "yq eval \".\\\"node-rpc-bind-addr\\\" = \\\"$node_rpc_bind_addr\\\"\" -i $storage_cfg_path"
281-
exec_on_host "$idx" "yq eval \".\\\"operator-rpc-url\\\" = \\\"$operator_rpc_url\\\"\" -i $storage_cfg_path"
282-
exec_on_host "$idx" "yq eval \".\\\"iroh-node-v4-addr\\\" = \\\"$iroh_node_v4_addr\\\"\" -i $storage_cfg_path"
283-
exec_on_host "$idx" "yq eval \".\\\"iroh-gateway-v4-addr\\\" = \\\"$iroh_gateway_v4_addr\\\"\" -i $storage_cfg_path"
284-
exec_on_host "$idx" "yq eval \".\\\"run-mode\\\" = \\\"$run_mode\\\"\" -i $storage_cfg_path"
285-
exec_on_host "$idx" "yq eval \".\\\"eth-rpc-url\\\" = \\\"http://127.0.0.1:$eth_api_port\\\"\" -i $storage_cfg_path"
279+
exec_on_host_simple "$idx" "yq eval \".\\\"objects-listen-addr\\\" = \\\"$objects_listen_addr\\\"\" -i $storage_cfg_path"
280+
exec_on_host_simple "$idx" "yq eval \".\\\"node-rpc-bind-addr\\\" = \\\"$node_rpc_bind_addr\\\"\" -i $storage_cfg_path"
281+
exec_on_host_simple "$idx" "yq eval \".\\\"operator-rpc-url\\\" = \\\"$operator_rpc_url\\\"\" -i $storage_cfg_path"
282+
exec_on_host_simple "$idx" "yq eval \".\\\"iroh-node-v4-addr\\\" = \\\"$iroh_node_v4_addr\\\"\" -i $storage_cfg_path"
283+
exec_on_host_simple "$idx" "yq eval \".\\\"iroh-gateway-v4-addr\\\" = \\\"$iroh_gateway_v4_addr\\\"\" -i $storage_cfg_path"
284+
exec_on_host_simple "$idx" "yq eval \".\\\"run-mode\\\" = \\\"$run_mode\\\"\" -i $storage_cfg_path"
285+
exec_on_host_simple "$idx" "yq eval \".\\\"eth-rpc-url\\\" = \\\"http://127.0.0.1:$eth_api_port\\\"\" -i $storage_cfg_path"
286286

287287
local register_flag=""
288288
if [ "$register_operator" = "true" ]; then
289289
register_flag=" --register-operator"
290290
fi
291291

292292
log_info "Starting storage services on $name..."
293-
if exec_on_host "$idx" "nohup $ipc_binary storage run --config $storage_cfg_path$register_flag > $node_home/storage.log 2>&1 &"; then
293+
if exec_on_host_simple "$idx" "nohup $ipc_binary storage run --config $storage_cfg_path$register_flag > $node_home/storage.log 2>&1 &"; then
294294
log_success "Storage services started on $name"
295295
started=$((started + 1))
296296
else

0 commit comments

Comments
 (0)