primer commit
This commit is contained in:
32
clean.sh
Executable file
32
clean.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# WhatsApp Gateway - Cleanup Script
|
||||
# Limpia sesiones, logs y cache
|
||||
|
||||
echo "🧹 Limpiando datos de WhatsApp Gateway..."
|
||||
|
||||
# 1. Limpiar sesión de WhatsApp (QR y vinculación)
|
||||
if [ -d "gateway/auth_info" ]; then
|
||||
echo "🗑️ Eliminando datos de sesión (gateway/auth_info)..."
|
||||
rm -rf gateway/auth_info/*
|
||||
# Mantener el directorio pero vacío
|
||||
touch gateway/auth_info/.keep
|
||||
else
|
||||
mkdir -p gateway/auth_info
|
||||
fi
|
||||
|
||||
# 2. Limpiar logs
|
||||
if [ -f "gateway/gateway.log" ]; then
|
||||
echo "🗑️ Eliminando log principal..."
|
||||
rm -f gateway/gateway.log
|
||||
fi
|
||||
|
||||
# 3. Limpiar logs de PM2 (si existen)
|
||||
if command -v pm2 &> /dev/null; then
|
||||
echo "🗑️ Limpiando logs de PM2..."
|
||||
pm2 flush > /dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
echo "✅ Limpieza completada!"
|
||||
echo "👉 Ahora puedes reiniciar los servicios:"
|
||||
echo " cd gateway && npm run dev"
|
||||
Reference in New Issue
Block a user