summaryrefslogtreecommitdiff
path: root/localbackupiceweaselprofile
blob: 53234020850418705c54ae23a4f09753eeaa106e (plain)
  1. #!/bin/sh
  2. set -e
  3. # Based on script by Micah Anderson <micah@riseup.net>
  4. CFGFILE="{CFGFILE:-${HOME}/.backupiceweaselprofile}"
  5. if -f "$CFGFILE"; then
  6. . "$CFGFILE"
  7. fi
  8. MOZDIR="${MOZDIR:-${HOME}/.mozilla/firefox}"
  9. # Change this to match your correct profile
  10. PROFILE="${PROFILE:-8xrm3et5.default}"
  11. exit1() {
  12. response="${1:+Error: }${1:-Internal error!}"
  13. echo >&2 "$response"
  14. exit 1
  15. }
  16. [ -d "${MOZDIR}/${PROFILE}" || exit1 "Profile $PROFILE missing. Perhaps set PROFILE in $CFGFILE"
  17. [ -n "$(mount | grep -F "${MOZDIR}/${PROFILE}" )" || mount "${MOZDIR}/${PROFILE}"
  18. if test -f "${MOZDIR}/${PROFILE}/.unpacked"; then
  19. rsync -av --delete --exclude .unpacked "${MOZDIR}/${PROFILE}/" "${MOZDIR}/profile/"
  20. else
  21. rsync -av "${MOZDIR}/profile/" "${MOZDIR}/$PROFILE/"
  22. touch "${MOZDIR}/${PROFILE}/.unpacked"
  23. fi