Skip to content

Commit f0e3b15

Browse files
committed
fix: reset to previous state do not try to run these here
1 parent 9d56a79 commit f0e3b15

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

scripts/90-cleanup.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,17 @@ elif [ -n "$(command -v apt-get)" ]; then
6161
apt-get -y update
6262
apt-get -y upgrade
6363
fi
64-
65-
# Set multi-user target (non-graphical) as default
66-
systemctl set-default multi-user.target
67-
systemctl disable getty@tty1.service
68-
systemctl mask getty@tty1.service
69-
systemctl mask graphical.target
70-
7164
rm -rf /tmp/* /var/tmp/*
7265
history -c
7366
cat /dev/null > /root/.bash_history
7467
unset HISTFILE
75-
76-
journalctl --rotate
77-
journalctl --vacuum-time=1s
7868
find /var/log -mtime -1 -type f -exec truncate -s 0 {} \;
7969
rm -rf /var/log/*.gz /var/log/*.[0-9] /var/log/*-????????
8070
rm -rf /var/lib/cloud/instances/*
8171
rm -f /root/.ssh/authorized_keys /etc/ssh/*key*
8272
touch /etc/ssh/revoked_keys
8373
chmod 600 /etc/ssh/revoked_keys
8474

85-
cat /dev/null > /var/log/lastlog
86-
cat /dev/null > /var/log/wtmp
87-
8875
# Securely erase the unused portion of the filesystem
8976
GREEN='\033[0;32m'
9077
NC='\033[0m'
@@ -103,5 +90,4 @@ dd if=/dev/zero of=/zerofile &
10390
sleep 5
10491
done
10592
sync; rm /zerofile; sync
106-
107-
fstrim /
93+
cat /dev/null > /var/log/lastlog; cat /dev/null > /var/log/wtmp

0 commit comments

Comments
 (0)