* /trunk/src/gpstools/postgres/Patch/track-id.patch
[gpstools.git] / gpslist
blob3ecba91d29525944868d4d168854ae24d6906f10
1 #!/bin/bash
3 #=======================================================================
4 # $Id$
5 # Read GPS data from stdin or file names at the command line and send a
6 # PostgreSQL table to stdout. Needs a database called "tmpgps" with the
7 # usual tables.
8 #=======================================================================
10 cat "$@" | gpst -o pgtab | psql -c "TRUNCATE logg; COPY logg FROM stdin;" tmpgps >/dev/null 2>&1
11 cd ~/bin/src/gpstools/postgres
12 psql -f "$HOME/bin/src/gpstools/postgres/allupdate.sql" tmpgps >/dev/null 2>&1
13 psql -f "$HOME/bin/src/gpstools/postgres/distupdate.sql" tmpgps >/dev/null 2>&1
14 psql -c "SELECT date as date, coor, sted, dist FROM logg ORDER BY date;" tmpgps