]> arthur.barton.de Git - iPhone2Mac.git/blobdiff - iPhone2Mac.sh
Add README file including installation instructions
[iPhone2Mac.git] / iPhone2Mac.sh
index f639cac44a6c12dfc59fa5b9f50404ec2fa1cb19..5ef17c03b7ee903842c1a30a13c02765657605c2 100755 (executable)
@@ -1,5 +1,14 @@
 #!/bin/bash
-# 2009-07-25, alex@barton.de
+#
+# iPhone2Mac -- save call logs from iPhone backups
+# Copyright (c)2009 Alexander Barton (alex@barton.de).
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# Please read the file COPYING and README for more information.
+#
 
 DEBUG=
 VERBOSE=1
@@ -46,20 +55,24 @@ fi
 verbose "iPhone Backup directory is \"$PWD\"."
 
 if [ -z "$call_db" ]; then
-       verbose "Locating SQLite call database ..."
+       verbose "Locating SQLite call database(s) ..."
        call_db=$(for f in `file * | fgrep SQLite | cut -d':' -f1`; do
                sqlite3 "$f" ".schema" | fgrep "CREATE TABLE call (" >/dev/null;
                [ $? -eq 0 ] && echo "$f"; done
        )
 fi
-verbose "Call database is \"$call_db\"."
+for f in $call_db; do
+       verbose "Found call database: \"$f\""
+done
 
 if [ -e "$CALL_LOG" ]; then
        debug "Copying existing ASCII call log ..."
        cp "$CALL_LOG" "$CALL_TMP" || abort "Can't copy old log file!"
 fi
-verbose "Dumping SQLite call databse ..."
-sqlite3 "$call_db" "select * from call;" >>"$CALL_TMP"
+for f in $call_db; do
+       verbose "Dumping SQLite call databse \"$f\" ..."
+       sqlite3 "$f" "select * from call;" >>"$CALL_TMP"
+done
 verbose "Sorting plain ASCII call log ..."
 sort -u "$CALL_TMP" >"$CALL_LOG"
 rm -f "$CALL_TMP"