41 lines
1.3 KiB
Bash
41 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
# Bash 1-liner installer for Maestri Remote Agent
|
|
# Usage: curl -sSL https://remote.winicomw.ddnsfree.com/install.sh | bash
|
|
|
|
set -e
|
|
|
|
echo -e "\033[36m========================================\033[0m"
|
|
echo -e "\033[36m Maestri Remote - Instalador de Agente \033[0m"
|
|
echo -e "\033[36m========================================\033[0m"
|
|
|
|
# Verifica Node.js
|
|
if ! command -v node >/dev/null 2>&1; then
|
|
echo -e "\033[31m[ERRO] Node.js nao encontrado no PATH.\033[0m"
|
|
echo -e "\033[33mPor favor, instale o Node.js v18+ antes de continuar.\033[0m"
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "\033[32m[OK] Node.js detectado: $(node --version)\033[0m"
|
|
|
|
INSTALL_DIR="$HOME/.maestri-remote"
|
|
mkdir -p "$INSTALL_DIR"
|
|
|
|
ZIP_URL="https://remote.winicomw.ddnsfree.com/maestri-agent.zip"
|
|
ZIP_PATH="$INSTALL_DIR/maestri-agent.zip"
|
|
|
|
echo -e "\n\033[33mBaixando pacote do agente de $ZIP_URL...\033[0m"
|
|
curl -sSL "$ZIP_URL" -o "$ZIP_PATH"
|
|
|
|
echo -e "\033[33mExtraindo arquivos em $INSTALL_DIR...\033[0m"
|
|
unzip -o -q "$ZIP_PATH" -d "$INSTALL_DIR"
|
|
rm -f "$ZIP_PATH"
|
|
|
|
cd "$INSTALL_DIR"
|
|
echo -e "\033[33mInstalando dependencias do agente...\033[0m"
|
|
npm install --omit=dev --no-audit --no-fund
|
|
|
|
echo -e "\n\033[32m[SUCESSO] Agente instalado com sucesso!\033[0m"
|
|
echo -e "\033[36mIniciando o agente local... (Pressione Ctrl+C para encerrar)\n\033[0m"
|
|
|
|
node bin/maestri-remote.js start
|