#!/bin/bash
### Autor: Emiliano Acosta ###
### Fecha: 12/09/25 ###
### Descripcion: Limpiar una VM Debian previo al realizado del template ###
### ------------------------------------------------------------------- ###

truncate -s 0 /etc/machine-id /var/lib/dbus/machine-id
rm -f /etc/udev/rules.d/70*
rm -f /var/lib/dhcp/dhclient.*
rm -f /etc/ssh/*key*
find /var/log -type f -exec rm {} +
echo "localhost" > /etc/hostname
passwd --lock root
history -c
history -w
unset HISTFILE
cat /dev/null > /home/debian/.bash_history
cat /dev/null > /root/.bash_history
rm /home/debian/debian-clean.sh
echo "Sistema limpio - Apagar "
