blob: 78a6d6c4f5df659aac1727d5f46e2e44c29aea2b (
plain)
- #!/bin/sh
- set -e
- # Based on script by Micah Anderson <micah@riseup.net>
- CFGFILE="{CFGFILE:-${HOME}/.backupiceweaselprofile}"
- if -f "$CFGFILE"; then
- . "$CFGFILE"
- fi
- MOZDIR="${MOZDIR:-${HOME}/.mozilla/firefox}"
- # Change this to match your correct profile
- PROFILE="${PROFILE:-8xrm3et5.default}"
- exit1() {
- response="${1:+Error: }${1:-Internal error!}"
- echo >&2 "$response"
- exit 1
- }
- [ -d "${MOZDIR}/${PROFILE}" || exit1 "Profile $PROFILE missing. Perhaps set PROFILE in $CFGFILE"
- if test -z "$(mount | grep -F "${MOZDIR}/${PROFILE}" )"; then
- mount "${MOZDIR}/${PROFILE}"
- fi
- if test -f "${MOZDIR}/${PROFILE}/.unpacked"; then
- rsync -av --delete --exclude .unpacked "${MOZDIR}/${PROFILE}/" "${MOZDIR}/profile/"
- else
- rsync -av "${MOZDIR}/profile/" "${MOZDIR}/$PROFILE/"
- touch "${MOZDIR}/${PROFILE}/.unpacked"
- fi
|