diff options
author | Christian Rößler | 2015-06-10 17:29:33 +0200 |
---|---|---|
committer | Christian Rößler | 2015-06-10 17:29:33 +0200 |
commit | bc0feb064e343b1d5499d3b246b33f8443a919ba (patch) | |
tree | 25037a5b0f591ba3c89ceb820714f3db69937a5e /satellit_installer/includes/99-clean_install.inc | |
parent | [SSPS] A stupid bug, perhaps just the first of many. (diff) | |
download | setup-scripts-bc0feb064e343b1d5499d3b246b33f8443a919ba.tar.gz setup-scripts-bc0feb064e343b1d5499d3b246b33f8443a919ba.tar.xz setup-scripts-bc0feb064e343b1d5499d3b246b33f8443a919ba.zip |
[SSPS] include file not named correctly
Diffstat (limited to 'satellit_installer/includes/99-clean_install.inc')
-rw-r--r-- | satellit_installer/includes/99-clean_install.inc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/satellit_installer/includes/99-clean_install.inc b/satellit_installer/includes/99-clean_install.inc new file mode 100644 index 0000000..952d4fe --- /dev/null +++ b/satellit_installer/includes/99-clean_install.inc @@ -0,0 +1,34 @@ +# Functions for cleaning some stuff after script run + +clean_logfiles() { + # delete only files, not directories + find /var/log -type f -delete + ERR=$? + [ $ERR -eq 0 ] && echo " ok." || echo " error cleaning log files." +} + +clean_authorized_hosts() { + [ -f /root/.ssh/authorized_keys ] && rm -f /root/.ssh/authorized_keys + ERR=$? + [ $ERR -eq 0 ] && echo " ok." || echo " error cleaning authorized keys file." +} + +clean_idrsa() { + [ -f /root/.ssh/id_rsa ] && rm -f /root/.ssh/id_rsa # rsa will suffice for our git keys + ERR=$? + [ $ERR -eq 0 ] && echo " ok." || echo " error cleaning id_rsa identity file." +} + +clean_install() { + GESERR=0 + echo "#" + echo "# Now, let's clean some unnecessary or harmful entries, e.g. " + echo "# entries in authorized_hosts, .bash_history and files beneath /var/log." + echo "#" + echo -n "# cleaning authorized_hosts ..." + clean_authorized_hosts + echo -n "# cleaning id_rsa private key ..." + clean_idrsa + echo -n "# cleaning log files ..." + clean_logfiles +} |