summaryrefslogtreecommitdiff
path: root/etc/mklocaluser.d/60-itzks-systems-roamingworkstation_prep-firefox
blob: 90636da0a394f043c4b40fde8687c0cfb2dbb3a9 (plain)
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
32
33
34
35
36
37
38
39
#!/bin/sh

set -e

GROUP=$(id -g "$USER")
HOMEDIR="/home/$USER"

# this is maily for Debian buster or rather Firefox versions that don't support
# the policies.json file

if [ -e "/usr/share/debian-edu-config/profiles.ini.ff" ]; then
	mkdir -p "$HOMEDIR/.mozilla/firefox/debian-edu.default"
	if [ ! -e "$HOMEDIR/.mozilla/firefox/profiles.ini" ]; then
		cp "/usr/share/debian-edu-config/profiles.ini.ff" "$HOMEDIR/.mozilla/firefox/profiles.ini"
	fi
fi

if [ -e "/usr/share/debian-edu-config/installs.ini" ]; then
	if [ ! -e "$HOMEDIR/.mozilla/firefox/installs.ini" ]; then
		cp "/usr/share/debian-edu-config/installs.ini" "$HOMEDIR/.mozilla/firefox/installs.ini"
	fi
fi

if [ -d "$HOMEDIR/.mozilla" ]; then
	chmod -R u+w,go-rwx "$HOMEDIR/.mozilla/"
	chown -R $USER:$GROUP "$HOMEDIR/.mozilla/"
fi

if [ -e "/usr/share/debian-edu-config/profiles.ini" ]; then
	mkdir -p "$HOMEDIR/.thunderbird/debian-edu.default"
	if [ ! -e "$HOMEDIR/.thunderbird/profiles.ini" ]; then
		cp "/usr/share/debian-edu-config/profiles.ini" "$HOMEDIR/.thunderbird/profiles.ini"
	fi
fi

if [ -d "$HOMEDIR/.thunderbird" ]; then
	chmod -R u+w,go-rwx "$HOMEDIR/.thunderbird/"
	chown -R $USER:$GROUP "$HOMEDIR/.thunderbird/"
fi