Skip to content

Commit 8cfeac1

Browse files
committed
When getting supported driver, do not fail when error is returned by makemkvcon. Instead, print the error messages.
1 parent bcc1bb3 commit 8cfeac1

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

rootfs/etc/cont-init.d/56-autodiscripper.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,21 @@ MAKEMKV_CLI="env HOME=$TMP_HOME LD_PRELOAD=/opt/makemkv/lib/libwrapper.so /opt/m
2626

2727
# Save drives information as seen by MakeMKV.
2828
echo "getting supported drives..."
29+
set +e
2930
$MAKEMKV_CLI -r --cache=1 --noscan info disc:9999 > "$TMP_HOME"/makemkvcon.output
31+
MAKEMKV_CLI_RC="$?"
32+
set -e
33+
34+
if [ "$MAKEMKV_CLI_RC" -ne 0 ]; then
35+
echo "ERROR: failed to get supported drives:"
36+
cat "$TMP_HOME"/makemkvcon.output | awk -F '","' '
37+
/^MSG:/ {
38+
sub(/^MSG:[^,]*,[^,]*,[^,]*,"/, "", $1);
39+
print $1;
40+
}' | sed 's/^/ /'
41+
42+
# cat "$TMP_HOME"/makemkvcon.output | grep "^MSG:" | cut -d ',' -f4 | tr -d '"' | sed 's/^/ /'
43+
fi
3044

3145
# Extract found drives.
3246
grep "^DRV:[0-9]\+,[0|1|2]," "$TMP_HOME"/makemkvcon.output > /tmp/.makemkv_supported_drives || true

0 commit comments

Comments
 (0)