-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup
31 lines (26 loc) · 1014 Bytes
/
cleanup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
RED='\033[1;31m'
NC='\033[0m'
echo -e "${RED}
################################################################################################################
# Your MarketPlace App has been deployed successfully! #
################################################################################################################
${NC}"
echo
echo -e "${RED}This message will be removed in the next login!${NC}"
#Cleanup script
rm -rf /usr/local/src/
mkdir -p /usr/local/src/
rm -rf /var/lib/cloud/instances/*
rm -rf /var/lib/cloud/data/*
find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; >/dev/null 2>&1
rm -rf /var/log/*.gz /var/log/*.[0-9] /var/log/*-????????
cat /dev/null > /var/log/lastlog; cat /dev/null > /var/log/wtmp
apt-get -y autoremove >/dev/null 2>&1
apt-get -y autoclean >/dev/null 2>&1
history -c
cat /dev/null > /root/.bash_history
unset HISTFILE
rm -rf /root/.bashrc
cp /etc/skel/.bashrc /root
rm -rf /opt/cloudstack