improve comments
This commit is contained in:
parent
13e95d015f
commit
307957e26a
1 changed files with 5 additions and 3 deletions
|
@ -37,14 +37,16 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# you can override the mysql.txt location by providing it via an environment variable
|
||||||
MYSQL_CONF_FILE=${MYSQL_CONF_FILE:-}
|
MYSQL_CONF_FILE=${MYSQL_CONF_FILE:-}
|
||||||
|
|
||||||
# only used for "set" operation:
|
# only used for "set" operation:
|
||||||
# use this channel number for all channels, that are listed in stdin
|
# 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
|
DEFAULT_CHANNEL=10000
|
||||||
|
|
||||||
# set DEBUG to a non-empty string to output the result sql statements instead of executing them
|
# 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}
|
DEBUG=${DEBUG:-false}
|
||||||
export DEBUG
|
export DEBUG
|
||||||
|
|
||||||
|
@ -56,6 +58,7 @@ for mysql_config in "$MYSQL_CONF_FILE" ~/.mythtv/mysql.txt /etc/mythtv/mysql.txt
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
# temporarily disable the "unset variable check" of bash
|
||||||
set +u
|
set +u
|
||||||
if test -z "$DBHostName" -o -z "$DBUserName" -o -z "$DBName" -o -z "$DBPassword"; then
|
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
|
echo "Failed to read the mysql settings file of MythTV." >&2
|
||||||
|
@ -66,7 +69,7 @@ set -u
|
||||||
|
|
||||||
send_mysql_statement() {
|
send_mysql_statement() {
|
||||||
if test "$DEBUG" != "false"; then
|
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 -
|
cat -
|
||||||
else
|
else
|
||||||
mysql -h "$DBHostName" -u "$DBUserName" --password="$DBPassword" --skip-column-names "$DBName"
|
mysql -h "$DBHostName" -u "$DBUserName" --password="$DBPassword" --skip-column-names "$DBName"
|
||||||
|
@ -108,7 +111,6 @@ case "$ACTION" in
|
||||||
current_num=$((current_num + 1))
|
current_num=$((current_num + 1))
|
||||||
done
|
done
|
||||||
) | send_mysql_statement
|
) | send_mysql_statement
|
||||||
|
|
||||||
;;
|
;;
|
||||||
merge)
|
merge)
|
||||||
input="$(cat -)"
|
input="$(cat -)"
|
||||||
|
|
Loading…
Reference in a new issue