ffmpeg-mythtv/myth-update-basename.sh
2020-07-27 17:33:47 -05:00

13 lines
425 B
Bash
Executable File

#!/bin/bash
set -e
set -x
chanid=$1
starttimeutc=$2
basename=$3
filesize=$(stat --printf="%s" $destdir/$basename)
dir="$HOME/.mythtv/"
config="config.xml"
mysql_password=$(awk -v FS='[<>]' '/Password/{print $3}' $dir/$config)
printf "update recorded set basename='%s', filesize='%s' where chanid=%s and starttime=%s;" $basename $filesize $chanid $starttimeutc | mysql --user=${USER} --password=${mysql_password} mythconverg