From 19af9b8d2ca67628c05c7b598cc54a44705adb72 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Wed, 4 Oct 2023 10:15:41 +0200 Subject: [PATCH] Add session cleanup script --- files/session-cleanup.sh | 10 ++++++++++ setup.yaml | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 files/session-cleanup.sh diff --git a/files/session-cleanup.sh b/files/session-cleanup.sh new file mode 100644 index 0000000..adc7742 --- /dev/null +++ b/files/session-cleanup.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Session cleanup for user student on logout + +if [ "${USERNAME}" = "student" ]; then + rm -rf /home/student/.cache/mozilla + rm -rf /home/student/.mozilla +fi + +exit 0 diff --git a/setup.yaml b/setup.yaml index 88fb43f..9754d3a 100644 --- a/setup.yaml +++ b/setup.yaml @@ -88,6 +88,12 @@ line: "DenyUsers student" create: true + - name: Copy session cleanup script + copy: + src: 'files/session-cleanup.sh' + dest: '/etc/gdm/PostSession/Default' + mode: '0755' + - name: Software hosts: all