mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 01:03:59 +00:00
Implemented cleanup feature
This commit is contained in:
parent
93dca2dee8
commit
8489525be2
53
how-to-create-encrypted-paper-backup/cleanup.sh
Executable file
53
how-to-create-encrypted-paper-backup/cleanup.sh
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
if [ "$1" = "--help" ]; then
|
||||||
|
printf "%s\n" "Usage: cleanup.sh"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
bold=$(tput bold)
|
||||||
|
red=$(tput setaf 1)
|
||||||
|
normal=$(tput sgr0)
|
||||||
|
|
||||||
|
tput reset
|
||||||
|
|
||||||
|
sudo mount -o rw,remount /
|
||||||
|
|
||||||
|
printf "%s\n" "Cleaning up…"
|
||||||
|
|
||||||
|
sudo apt-get autoclean
|
||||||
|
|
||||||
|
sudo rm -fr /etc/ssh/*_host_* || true
|
||||||
|
sudo rm -fr /home/pi/.ssh || true
|
||||||
|
sudo rm -fr /home/pi/cleanup.sh* || true
|
||||||
|
sudo rm -fr /home/pi/test* || true
|
||||||
|
sudo rm -fr /tmp/* || true
|
||||||
|
sudo rm -fr /var/cache/apt/archives/* || true
|
||||||
|
sudo rm -fr /var/lib/dhcpcd5/* || true
|
||||||
|
sudo rm -fr /var/log/* || true
|
||||||
|
sudo rm -fr /var/tmp/* || true
|
||||||
|
|
||||||
|
printf "%s\n" "Done"
|
||||||
|
|
||||||
|
coutdown() {
|
||||||
|
tput rc
|
||||||
|
tput ed
|
||||||
|
second_s="seconds"
|
||||||
|
if [ "$1" = "1" ]; then
|
||||||
|
second_s="second"
|
||||||
|
fi
|
||||||
|
printf "$bold%s$normal" "Rebooting in $1 $second_s"
|
||||||
|
}
|
||||||
|
|
||||||
|
tput sc
|
||||||
|
|
||||||
|
for ((index=10; index > 0; index--))
|
||||||
|
do
|
||||||
|
coutdown $index
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
sudo systemctl reboot
|
16
how-to-create-encrypted-paper-backup/cleanup.sh.sig
Normal file
16
how-to-create-encrypted-paper-backup/cleanup.sh.sig
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
|
iQIzBAABCgAdFiEEqYzNEiJDZVsm+vthH6dnhiu9EwUFAmC8vg8ACgkQH6dnhiu9
|
||||||
|
EwX5BA//aHIG6Hy5PG/achuREBxPJnYbcYCVnwvWayFgVnFykHLnPgu7kQqsYdQB
|
||||||
|
ikHfNhaJyrx7gNWT1inRqmvHRstgSBcWI1VD3TVv7G/XdxHZmndl3M7alAZHeOIU
|
||||||
|
iMnDYJeqiqkKsQmIrBg/tChUw+tL6tNbpGWAzcLks7jZl8IQgjRQKe3KZeLZKzfi
|
||||||
|
8JOChowSSRAnD3Rkfhb6aILX6IRA2XcjOMgQkjZLzWBo35B7KdspCLgH14I3kXlt
|
||||||
|
yazco1LnzasBAM0lOUyytiixj6bMfNISMJRZjReZZsTpvWDGkphGVhuMOUDfdYP/
|
||||||
|
DGjksSTHi8BhMqaObGya2E7P6tGPgkfrZVwjGdQA4tZlzgDmRr/6rnLA/6ABAxIm
|
||||||
|
nsTlKPV3kQzsakFbNUPN6pubUc+vUvPaGXfsSTdx5Z1fJVc6YEZ10Ylhr0VNig0b
|
||||||
|
+R27XMjj2OEhJBmk6kirJkvN68g1be0YhKSVCiBPF1LUQNtse6uj1x/OevJXnK36
|
||||||
|
jPIVXv8zCJIe5usKFPtrqkJJymYsiqPtpLsIlxcpJ/V6qXJhZrgyl9CwyIBiGM9N
|
||||||
|
du5tj7JU+QjFpqxlltN0kULMRpSu+0zPILMLphVnm/B5qV2ztf9ppHNq7fWF90ne
|
||||||
|
BD7vse5pHh3l5zdb8dyHVsre0BqSir8tGZL54hHQ5tMy35divME=
|
||||||
|
=uv+s
|
||||||
|
-----END PGP SIGNATURE-----
|
Loading…
x
Reference in New Issue
Block a user