75 lines
2.4 KiB
Bash
75 lines
2.4 KiB
Bash
#!/bin/bash
|
|
# DÉPLOIEMENT GUARD + NONREG + VAULT GLOBAL
|
|
echo "=== GUARD + NONREG DEPLOYMENT ==="
|
|
|
|
# S89 (Master) - Enrichir guard existant
|
|
echo "S89: Enrichir guard..."
|
|
if [ ! -f /opt/wevads/vault/.gitignore ]; then
|
|
echo ".env*" > /opt/wevads/vault/.gitignore
|
|
echo "*.key" >> /opt/wevads/vault/.gitignore
|
|
fi
|
|
|
|
# S88 - Deploy guard system
|
|
echo "S88: Deploy guard..."
|
|
sshpass -p 'NKPwP4%M9PBdw' ssh -o StrictHostKeyChecking=no root@88.198.4.195 '
|
|
mkdir -p /opt/wevads-v2/vault /opt/wevads-v2/scripts
|
|
cat > /opt/wevads-v2/scripts/auto-guard.sh << "GUARD_EOF"
|
|
#!/bin/bash
|
|
# Auto Guard S88 - Check critical files
|
|
FILES="/var/www/weval/wevia-ia/wevia-api.php /etc/nginx/sites-enabled/wevia-dark"
|
|
for f in $FILES; do
|
|
if [ -f "$f" ]; then
|
|
if [ ! -f "$f.gold.13Mar2026" ]; then
|
|
cp "$f" "$f.gold.13Mar2026"
|
|
echo "GOLD: $f backed up"
|
|
fi
|
|
fi
|
|
done
|
|
GUARD_EOF
|
|
chmod +x /opt/wevads-v2/scripts/auto-guard.sh
|
|
/opt/wevads-v2/scripts/auto-guard.sh
|
|
'
|
|
|
|
# S202 - Minimal guard
|
|
echo "S202: Deploy minimal guard..."
|
|
timeout 10 ssh -p 49222 -o StrictHostKeyChecking=no root@204.168.152.13 '
|
|
mkdir -p /opt/guard/vault
|
|
echo "#!/bin/bash" > /opt/guard/pmta-guard.sh
|
|
echo "cp /etc/pmta/config /opt/guard/vault/pmta-config.gold.13Mar2026 2>/dev/null" >> /opt/guard/pmta-guard.sh
|
|
chmod +x /opt/guard/pmta-guard.sh
|
|
' || echo "S202 timeout"
|
|
|
|
# S151 - Tracking guard
|
|
echo "S151: Deploy tracking guard..."
|
|
timeout 10 sshpass -p 'MX8D3zSAty7k3243242' ssh -o StrictHostKeyChecking=no ubuntu@151.80.235.110 '
|
|
sudo mkdir -p /opt/tracking-guard
|
|
sudo cat > /opt/tracking-guard/guard.sh << "TRACK_EOF"
|
|
#!/bin/bash
|
|
# Tracking Guard S151
|
|
FILES="/var/www/html/tracking.php /var/www/html/tracking-monitor.php /etc/nginx/sites-enabled/default"
|
|
for f in $FILES; do
|
|
if [ -f "$f" ]; then
|
|
sudo cp "$f" "/opt/tracking-guard/$f.gold.13Mar2026"
|
|
fi
|
|
done
|
|
TRACK_EOF
|
|
sudo chmod +x /opt/tracking-guard/guard.sh
|
|
sudo /opt/tracking-guard/guard.sh
|
|
' || echo "S151 failed"
|
|
|
|
echo "=== NONREG SCRIPTS ==="
|
|
# Deploy nonreg partout
|
|
echo "Creating master nonreg..."
|
|
cat > /opt/wevads/scripts/nonreg-master.sh << "NONREG_EOF"
|
|
#!/bin/bash
|
|
# NONREG MASTER - Test tous serveurs
|
|
echo "🎯 NONREG MASTER - Fri Mar 13 14:25:24 UTC 2026"
|
|
|
|
# S89 Local
|
|
echo "S89: TOC Master"
|
|
bash /opt/wevads/scripts/toc-6sigma.sh | tail -2
|
|
|
|
# S88 Remote
|
|
echo "S88: WEVIA"
|
|
sshpass -p 'NKPwP4%M9PBdw' ssh -o StrictHostKeyChecking=no root@88.198.4.195 'curl -s localhost:5880/ | wc -c; echo
|