Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
603 B

4 years ago
  1. #!/bin/bash
  2. source ~/.profile
  3. if [ ! "$BROWSER" = "firefox" ]; then
  4. echo "Default browser is not firefox, exiting..."
  5. exit 0
  6. fi
  7. source $HOME/.config.env
  8. static=static-$FIREFOX_PROFILE
  9. link=$FIREFOX_PROFILE
  10. volatile=/dev/shm/firefox-$FIREFOX_PROFILE-$USER
  11. IFS=
  12. set -efu
  13. cd ~/.mozilla/firefox
  14. if [ ! -r $volatile ]; then
  15. mkdir -m0700 $volatile
  16. fi
  17. if [ "$(readlink $link)" != "$volatile" ]; then
  18. mv $link $static
  19. ln -s $volatile $link
  20. fi
  21. if [ -e $link/.unpacked ]; then
  22. rsync -av --delete --exclude .unpacked ./$link/ ./$static/
  23. else
  24. rsync -av ./$static/ ./$link/
  25. touch $link/.unpacked
  26. fi