iceweasel-hardened.sh 990 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. ##############################################
  3. # Iceweasel-Hardened Jail and Cleaner Script #
  4. ##############################################
  5. echo "Closing any other instances of Iceweasel to avoid crashes..."
  6. pkill -x iceweasel
  7. wait
  8. echo "Copying Hardened Prefs..."
  9. cp /usr/lib/iceweasel/browser/defaults/preferences/iceweasel-hardened.prefs /usr/lib/iceweasel/browser/defaults/preferences/firefox-branding.js
  10. wait
  11. echo "Waking the Iceweasel..."
  12. # Trap cleaner function for Iceweasel exit cleaning
  13. function finish {
  14. echo "Removing hardened preferences..."
  15. echo "" > /usr/lib/iceweasel/browser/defaults/preferences/firefox-branding.js
  16. }
  17. ## Firejail Iceweasel startup
  18. TZ="UTC" /usr/bin/firejail --profile=/etc/firejail/firefox.profile --noroot --nogroups --caps.drop=all --private-etc=nsswitch.conf,resolv.conf --private-bin=sh,bash,iceweasel --private-tmp --private-dev /usr/bin/iceweasel --private-window -no-remote
  19. ## Exiting Iceweasel triggers the trap
  20. trap finish EXIT