From 8ba875e37e8c96a884b9a634edf0840c93a4c947 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 28 Jul 2016 20:38:00 +0100 Subject: [PATCH] Remove some extra files on shutdown --- src/freedombone-image-mesh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/freedombone-image-mesh b/src/freedombone-image-mesh index 60916fe7..6da52176 100755 --- a/src/freedombone-image-mesh +++ b/src/freedombone-image-mesh @@ -480,7 +480,18 @@ function mesh_amnesic { echo '#!/bin/bash' > /usr/bin/amnesic echo '' >> /usr/bin/amnesic + echo 'MY_USERNAME=$1' >> /usr/bin/amnesic echo 'tomb slam all' >> /usr/bin/amnesic + echo "if [ -f /home/${MY_USERNAME}/.bash_history ]; then" >> /usr/bin/amnesic + echo " shred -zu /home/${MY_USERNAME}/.bash_history" >> /usr/bin/amnesic + echo 'fi' >> /usr/bin/amnesic + echo "if [ -f /home/${MY_USERNAME}/.ssh/authorized_keys ]; then" >> /usr/bin/amnesic + echo " shred -zu /home/${MY_USERNAME}/.ssh/authorized_keys" >> /usr/bin/amnesic + echo " echo '' > /home/${MY_USERNAME}/.ssh/authorized_keys" >> /usr/bin/amnesic + echo 'fi' >> /usr/bin/amnesic + echo "if [ -f /home/${MY_USERNAME}/.xsession-errors ]; then" >> /usr/bin/amnesic + echo " shred -zu /home/${MY_USERNAME}/.xsession-errors" >> /usr/bin/amnesic + echo 'fi' >> /usr/bin/amnesic echo '' >> /usr/bin/amnesic echo 'exit 0' >> /usr/bin/amnesic chmod +x /usr/bin/amnesic @@ -495,7 +506,7 @@ function mesh_amnesic { echo 'Type=oneshot' >> /etc/systemd/system/amnesic.service echo 'RemainAfterExit=true' >> /etc/systemd/system/amnesic.service echo 'ExecStart=/bin/true' >> /etc/systemd/system/amnesic.service - echo "ExecStop=/usr/bin/amnesic" >> /etc/systemd/system/amnesic.service + echo "ExecStop=/usr/bin/amnesic $MY_USERNAME" >> /etc/systemd/system/amnesic.service echo '' >> /etc/systemd/system/amnesic.service echo '[Install]' >> /etc/systemd/system/amnesic.service echo 'WantedBy=multi-user.target' >> /etc/systemd/system/amnesic.service