# Auto Restart

Create new file named run\_aztech.sh

```
sudo nano run_aztec.sh
```

then add code below:

```
#!/bin/bash

# Function to run the aztec command
run_aztec() {
    aztec start --node --archiver --sequencer \
        --network alpha-testnet \
        --l1-rpc-urls http://YOUR_RPC_URL \
        --l1-consensus-host-urls http://YOUR_BEACON_URL \
        --sequencer.validatorPrivateKey YOUR_PRIVATE_KEY\
        --sequencer.coinbase YOUR_ADDRESS \
        --p2p.p2pIp 38.102.84.231 \
        --p2p.maxTxPoolSize 1000000000 \
        --port 8081
}

# Trap Ctrl+C (SIGINT) to exit the script
trap "echo 'Script stopped by user'; exit" SIGINT

# Main loop
while true; do
    echo "Starting aztec command..."
    run_aztec
    
    # If the command fails, wait 5 seconds before restarting
    if [ $? -ne 0 ]; then
        echo "Command failed or exited. Restarting in 5 seconds..."
        sleep 5
    else
        # If the command exited successfully (unlikely in this case), break the loop
        echo "Command exited successfully. Stopping."
        break
    fi
done
```

use CTRL+X , Y , Enter to save the file

allow the file to be executed

```
chmod +x run_aztec.sh
```

to run the script you just need to use command:&#x20;

```
./run_aztec.sh
```

Stopping the command you'll need to use CTRL+C


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.codeblocklabs.com/blockchain-nodes/aztec-network/auto-restart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
