03-ago: [videoclub] descarga a NAS Synology via Download Station + comando 'descargar' en pi_bot (deploy en Pi)
This commit is contained in:
34
vigilancia/deploy_pi.sh
Normal file
34
vigilancia/deploy_pi.sh
Normal 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>"
|
||||
Reference in New Issue
Block a user