From c7aad4d5c6abb82fef915287692eb0ef9e83483e Mon Sep 17 00:00:00 2001 From: Eduard Toloza Date: Wed, 5 Dec 2018 14:39:46 +0000 Subject: [PATCH] Add firefox sync profile --- user-bin/firefox-sync | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 user-bin/firefox-sync diff --git a/user-bin/firefox-sync b/user-bin/firefox-sync new file mode 100644 index 0000000..312c4d1 --- /dev/null +++ b/user-bin/firefox-sync @@ -0,0 +1,26 @@ +#!/bin/sh + +static=static-$1 +link=$1 +volatile=/dev/shm/firefox-$1-$USER + +IFS= +set -efu + +cd ~/.mozilla/firefox + +if [ ! -r $volatile ]; then + mkdir -m0700 $volatile +fi + +if [ "$(readlink $link)" != "$volatile" ]; then + mv $link $static + ln -s $volatile $link +fi + +if [ -e $link/.unpacked ]; then + rsync -av --delete --exclude .unpacked ./$link/ ./$static/ +else + rsync -av ./$static/ ./$link/ + touch $link/.unpacked +fi \ No newline at end of file