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.

34 lines
559 B

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