Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
[#405] get_dropbox_folder hack for latest Dropbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Jun 23, 2014
1 parent 6791020 commit fc85e79
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Hive/get_dropbox_folder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ function get_dropbox_folder {
then
fatal "Please install sqlite3"
fi

# which database have we got?
if [ -f "$HOME/.dropbox/config.db" ]
if [ -f "$HOME/.dropbox/info.json" ]
then
info="$HOME/.dropbox/info.json"
DROPBOX_FOLDER=$(cat "$info" | grep '"personal": {"path":' | sed -E -e 's/.*"personal": {"path": "([^"]+)".*/\1/')
return
elif [ -f "$HOME/.dropbox/config.db" ]
then
local DBFILE="$HOME/.dropbox/config.db"
local DBVER=$( "$SQLITE3" -noheader "$DBFILE" 'SELECT value FROM config WHERE key="config_schema_version"' )
Expand All @@ -71,6 +77,7 @@ function get_dropbox_folder {
else
fatal "Dropbox database not found, is dropbox installed?"
fi

# get the desired value
if [ $DBVER -eq 0 ]
then
Expand All @@ -85,6 +92,7 @@ function get_dropbox_folder {
else
fatal "Unhandled DB schema version $DBVER"
fi

if [ -z "$DBVALUE" ]
then
# value not set, read value from host.db instead
Expand Down

0 comments on commit fc85e79

Please sign in to comment.