#!/bin/sh

if pidof firefox-bin >/dev/null 2>&1; then
    exit
fi

for file in ${HOME}/.mozilla/firefox/????????.default/places.sqlite; do
    [ -e $file.bak ] || cp $file $file.bak
    /usr/share/sendai/foxmarks.pl restore $file < /usr/share/sendai/bookmarks.default
done

[ -e ${HOME}/.config/autostart/foxmarks.desktop ] && rm ${HOME}/.config/autostart/foxmarks.desktop
