Add firefox sync profile

This commit is contained in:
Eduard Tolosa 2018-12-05 14:39:46 +00:00
parent 792fb52f3a
commit c7aad4d5c6

26
user-bin/firefox-sync Normal file
View file

@ -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