Some checks failed
Tests / check (push) Failing after 39s
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
20 lines
592 B
Bash
20 lines
592 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
empty_dir () {
|
|
[ -d "${1}" ] && find "${1}" -mindepth 1 -delete
|
|
return 0
|
|
}
|
|
|
|
for d in /mnt/var/cache/dnf /mnt/var/cache/yum /mnt/root/.ssh /mnt/tmp /mnt/var/tmp /mnt/var/lib/dhcp /mnt/var/lib/cloud; do
|
|
empty_dir "${d}"
|
|
done
|
|
rm -f /mnt/root/.bash_history
|
|
find /mnt/var/log ! -type d -delete
|
|
find /mnt/etc/ssh -maxdepth 1 -name 'ssh_host_*' -delete
|
|
if [ -f /mnt/etc/machine-id ]; then
|
|
: > /mnt/etc/machine-id
|
|
fi
|
|
if [ -f /mnt/var/lib/dbus/machine-id ] && [ ! -L /mnt/var/lib/dbus/machine-id ]; then
|
|
rm -f /mnt/var/lib/dbus/machine-id
|
|
fi
|