2014-08-13 18:05:18 +02:00
|
|
|
#!/bin/sh
|
2013-01-31 11:53:15 +00:00
|
|
|
#
|
|
|
|
# Fetch DVB scan files
|
|
|
|
#
|
|
|
|
|
|
|
|
# Arguments
|
|
|
|
DIR=$1
|
2013-03-07 20:16:54 -07:00
|
|
|
[ -z "$DIR" ] && DIR=$(dirname "$0")/../data/dvb-scan
|
2013-01-31 11:53:15 +00:00
|
|
|
|
|
|
|
# Update
|
2013-03-07 20:16:54 -07:00
|
|
|
if [ -d "${DIR}/.git" ]; then
|
2014-05-23 20:42:28 +02:00
|
|
|
LAST=$(pwd)
|
|
|
|
cd "${DIR}" || exit 1
|
2014-08-29 17:41:21 +01:00
|
|
|
git fetch > /dev/null 2>&1 || exit 1
|
2014-08-16 11:41:20 +01:00
|
|
|
git reset --hard > /dev/null 2>&1 || exit 1
|
2014-08-29 17:41:21 +01:00
|
|
|
git pull > /dev/null 2>&1 || exit 1
|
2014-05-23 20:42:28 +02:00
|
|
|
cd "${LAST}" || exit 1
|
2013-01-31 11:53:15 +00:00
|
|
|
# Fetch
|
2013-03-07 20:16:54 -07:00
|
|
|
elif [ ! -d "${DIR}" ]; then
|
2013-03-07 20:27:04 -07:00
|
|
|
URL=http://linuxtv.org/git/dtv-scan-tables.git
|
2014-08-16 11:41:20 +01:00
|
|
|
git clone $URL "${DIR}" > /dev/null 2>&1 || exit 1
|
2013-01-31 11:53:15 +00:00
|
|
|
fi
|
2013-02-15 14:14:45 +00:00
|
|
|
|
|
|
|
# Note: will not update existing set (if not .git)
|
2014-03-05 11:37:18 +00:00
|
|
|
exit 0
|