# Installation (Light node)

## ***Automatic Installation***

```bash
source <(curl -s https://raw.githubusercontent.com/NodersUA/Scripts/main/avail-light)
```

## ***Manual Installation***

```bash
sudo bash -c "cat > /root/.avail/availscript.sh" <<EOF
#!/bin/bash
# official script command of Avail script from daningyn
COMMAND="curl -sL1 avail.sh | bash"
# Here is script making LC restart if getting errors
while true; do echo "Starting command: \$COMMAND"
    # Run command in the background
    bash -c "\$COMMAND" &

    PID=\$!

    wait \$PID; EXIT_STATUS=\$?
    if [ \$EXIT_STATUS -eq 0 ]; then 
        echo "Command exited successfully. Restarting..."
    else 
        echo "Command failed with status \$EXIT_STATUS. Restarting..."
    fi

    sleep 10
done
EOF
```

```bash
chmod +x /root/.avail/availscript.sh
```

```bash
sudo bash -c "cat > /etc/systemd/system/avail_light.service" <<EOF
[Unit] 
Description=Avail Light Client
After=network.target
StartLimitIntervalSec=0
[Service] 
User=$USER 
ExecStart=/root/.avail/availscript.sh
Restart=always 
RestartSec=120
[Install] 
WantedBy=multi-user.target

EOF
```

```bash
systemctl daemon-reload
systemctl enable avail_light
systemctl restart avail_light && journalctl -u avail_light -f -o cat
```


---

# 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://nodersua.gitbook.io/about-nodersua/archive/avail/installation-light-node.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.
