summaryrefslogtreecommitdiff
path: root/nonprism/iceweasel-hardened-preferences/iceweasel-hardened.sh
blob: 9a0842f341313b330f56123559a71a227495809a (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
#!/bin/sh

##############################################
# IceWeasel-Hardened Jail and Cleaner Script #
##############################################
echo "Closing any other instances of IceWeasel to avoid crashes..."
pkill -x iceweasel
wait
echo "Copying Hardened Prefs..."
cp /usr/lib/iceweasel/browser/defaults/preferences/iceweasel-branding.js /usr/lib/iceweasel/browser/defaults/preferences/firefox-branding.js
wait
echo "Waking the IceWeasel..."

# Trap cleaner function for IceWeasel exit cleaning
function finish {
echo "Removing hardened preferences..."
echo "" > /usr/lib/iceweasel/browser/defaults/preferences/firefox-branding.js
    }

## Firejail IceWeasel startup
/usr/bin/firejail --profile=/etc/firejail/firefox.profile --noroot --nogroups --caps.drop=all --private-etc=nsswitch.conf,resolv.conf  --private-bin=bash,iceweasel --private-tmp --private-dev /usr/bin/iceweasel --private-window

## Exiting IceWeasel triggers the trap
trap finish EXIT