icedove-hardened.sh 994 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. ##############################################
  3. # Icedove-Hardened Jail and Cleaner Script #
  4. ##############################################
  5. echo "Closing any other instances of Icedove to avoid crashes..."
  6. pkill -x icedove
  7. wait
  8. echo "Copying Hardened Prefs..."
  9. cp /usr/lib/icedove/defaults/preferences/icedove-branding.js /usr/lib/icedove/defaults/preferences/thunderbird-branding.js
  10. wait
  11. echo "Waking the Icedove..."
  12. # Trap cleaner function for IceDove exit cleaning
  13. function finish {
  14. echo "Removing hardened preferences..."
  15. echo "" > /usr/lib/icedove/defaults/preferences/thunderbird-branding.js
  16. }
  17. ## Firejail Icedove startup
  18. /usr/bin/firejail --profile=/etc/firejail/icedove.profile --private-bin=bash,sh,gpg2,pinentry,pinentry-gnome3,pinentry-curses,pinentry-tty,pinentry-gtk-2,pinentry-qt,pinentry-emacs,gpg-agent,icedove --private-tmp --private-etc=nsswitch.conf,resolv.conf --private-dev --nogroups /usr/bin/icedove
  19. ## Exiting Icedove triggers the trap
  20. trap finish EXIT