03-ago: [videoclub] descarga a NAS Synology via Download Station + comando 'descargar' en pi_bot (deploy en Pi)

This commit is contained in:
juanjo
2026-08-03 23:35:33 +02:00
parent c2caae0ba7
commit f452ece724
5 changed files with 178 additions and 76 deletions

34
vigilancia/deploy_pi.sh Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
# deploy_pi.sh — Despliegue manual en la Raspberry Pi (minipc).
# Uso en la Pi: bash /home/pi/minipc/vigilancia/deploy_pi.sh
set -e
REPO=/home/pi/minipc
ENV_FILE=$REPO/vigilancia/.env
echo "==> git pull en $REPO"
cd "$REPO"
git pull
echo "==> Comprobar credenciales NAS en $ENV_FILE"
if ! grep -q "^NAS_HOST=" "$ENV_FILE" 2>/dev/null; then
echo "AVISO: falta NAS_HOST/NAS_USER/NAS_PASS en $ENV_FILE"
echo "Anade al final del .env:"
echo " NAS_HOST=192.168.50.31"
echo " NAS_PORT=5000"
echo " NAS_USER=<usuario>"
echo " NAS_PASS=<password>"
echo " NAS_HTTPS=0"
exit 1
fi
echo "==> Reiniciar pi-bot"
sudo systemctl restart pi-bot
sleep 2
systemctl is-active pi-bot
echo "==> Comprobar sintaxis nas_dl.py"
cd "$REPO/vigilancia"
python3 -m py_compile nas_dl.py pi_bot.py && echo "OK sintaxis"
echo "==> Listo. Prueba: envia a @juanjer_casa_bot: descargar <enlace|magnet>"