]> git.phdru.name Git - bookmarks_db.git/blob - bkmk2db
Minor refactoring
[bookmarks_db.git] / bkmk2db
1 #! /bin/sh
2 # Convert bookmarks to DB
3 #
4 # This file is a part of Bookmarks database and Internet robot.
5 #
6 # __author__ = "Oleg Broytman <phd@phdru.name>"
7 # __copyright__ = "Copyright (C) 2000-2014 PhiloSoft Design"
8 # __license__ = "GNU GPL"
9
10 . "`dirname \"$0\"`"/set-path
11
12 if [ ! -f ./bookmarks_db.pickle -a ! -f ./bookmarks_db.flad ]; then
13    if [ -f ./bookmarks.html ]; then
14       BKMK=bookmarks.html
15    elif [ -f "$HOME/.mozilla/bookmarks.html" ]; then
16       BKMK="$HOME/.mozilla/bookmarks.html"
17    elif [ -f "$HOME/.netscape/bookmarks.html" ]; then
18       BKMK="$HOME/.netscape/bookmarks.html"
19    else
20       echo Cannot find bookmarks.html, aborted
21       exit 1
22    fi
23
24    bkmk2db.py "$BKMK" || exit 1
25
26 elif [ -f ./bookmarks_db.pickle -a -f ./bookmarks.html -a ./bookmarks.html -nt ./bookmarks_db.pickle ]; then
27    bkmk2db.py || exit 1
28
29 elif [ -f ./bookmarks_db.flad -a -f ./bookmarks.html -a ./bookmarks.html -nt ./bookmarks_db.flad ]; then
30    bkmk2db.py || exit 1
31
32 fi