improve comments

lars 13 years ago
parent 13e95d015f
commit 307957e26a
  1. 8
      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 -)"

Loading…
Cancel
Save