#!/bin/sh
NZ_MIRROR_URL="https://stuff.furrr.kr/nz"

install_agent() {
    curl -L -o /tmp/install_agent.sh "${NZ_MIRROR_URL}/install_agent.sh"
    chmod +x /tmp/install_agent.sh
    /tmp/install_agent.sh "$@"
}

case $1 in
    "install_agent")
        shift
        install_agent "$@"
        ;;
    *)
        echo "Usage: ./nezha.sh install_agent <host> <port> <secret>"
        ;;
esac
