From 307957e26ab3ab1454af86ed12f9401a9a358439 Mon Sep 17 00:00:00 2001 From: lars Date: Mon, 24 May 2010 12:29:51 +0000 Subject: [PATCH] improve comments --- mythtv/channel_sort_mythtv.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mythtv/channel_sort_mythtv.sh b/mythtv/channel_sort_mythtv.sh index 4c511d8..0b062d0 100755 --- a/mythtv/channel_sort_mythtv.sh +++ b/mythtv/channel_sort_mythtv.sh @@ -37,14 +37,16 @@ set -eu +# you can override the mysql.txt location by providing it via an environment variable MYSQL_CONF_FILE=${MYSQL_CONF_FILE:-} # only used for "set" operation: # use this channel number for all channels, that are listed in stdin -# set to an empty string, if the channels, that are not listed, should remain untouched +# set it to an empty string, if the channels, that are not listed, should remain untouched DEFAULT_CHANNEL=10000 # set DEBUG to a non-empty string to output the result sql statements instead of executing them +# use something like "export DEBUG=true" before running this script to enable debug mode DEBUG=${DEBUG:-false} export DEBUG @@ -56,6 +58,7 @@ for mysql_config in "$MYSQL_CONF_FILE" ~/.mythtv/mysql.txt /etc/mythtv/mysql.txt break fi done +# temporarily disable the "unset variable check" of bash set +u if test -z "$DBHostName" -o -z "$DBUserName" -o -z "$DBName" -o -z "$DBPassword"; then echo "Failed to read the mysql settings file of MythTV." >&2 @@ -66,7 +69,7 @@ set -u send_mysql_statement() { if test "$DEBUG" != "false"; then - # show a blank first line, since it would get removed in "get" otherwise + # only output the sql statements - don't execute them cat - else mysql -h "$DBHostName" -u "$DBUserName" --password="$DBPassword" --skip-column-names "$DBName" @@ -108,7 +111,6 @@ case "$ACTION" in current_num=$((current_num + 1)) done ) | send_mysql_statement - ;; merge) input="$(cat -)"