Guest User

Untitled

a guest
Jun 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. PROFILE="ram"
  4.  
  5. cd "${HOME}/.mozilla/firefox"
  6.  
  7. grep firefox /etc/mtab &> /dev/null || mount "${HOME}/.mozilla/firefox/${PROFILE}" || exit 1
  8.  
  9. if [ -f "${PROFILE}/.unpacked" ]
  10. then
  11. # Check for a firefox instance; the point of tmpfs is
  12. # limiting writes, and a backup every 10 mins...
  13. # Does that really contain writes?
  14. pgrep firefox &> /dev/null || exit 1
  15. tar --exclude ".unpacked" -cpf ram.tmp.tar "$PROFILE"
  16. mv ram.tar{,.old}
  17. mv ram.{tmp.,}tar
  18. else
  19. tar xpf ram.tar || exit 1
  20. touch "${PROFILE}/.unpacked"
  21. fi
Add Comment
Please, Sign In to add comment