muxsa-kvm2png: adjust for Debian Bookworm

This commit is contained in:
Sebastian Kiesel 2023-08-06 12:59:56 +02:00
parent f6df2d62c1
commit 073c5b8cd8

View File

@ -62,7 +62,7 @@ echo
############################################################################
TMP_FILE="$(mktemp -t muxsa-kvm2png-XXXXXXXXXX.ppm)"
TMP_FILE="$(mktemp -t muxsa-kvm2png-XXXXXXXXXX.png)"
if [ ! -w "${TMP_FILE}" ] ; then
echo "Error: cannot create tmp_file. abort."
exit 1
@ -193,12 +193,26 @@ while true ; do
echo "Outfile ${OUTFILE} exists and overwriting not allowed. abort."
exit 1
fi
echo "Converting and saving screenshot to ${OUTFILE}"
pnmtopng -force "${TMP_FILE}" > "$OUTFILE"
if [ $? -ne 0 ] ; then
echo "Converting and saving screenshot failed. abort."
exit 1
fi
TMPFORMAT="$(identify -format "%m" "${TMP_FILE}")"
case "${TMPFORMAT}" in
PNG)
echo -n "copy "
cp -v "${TMP_FILE}" "${OUTFILE}"
;;
PPM)
echo "pnmtopng -force \"${TMP_FILE}\" > \"${OUTFILE}\""
pnmtopng -force "${TMP_FILE}" > "${OUTFILE}"
if [ $? -ne 0 ] ; then
echo "Converting and saving screenshot failed. abort."
exit 1
fi
;;
*)
echo "File ${TMP_FILE} has unknown format ${TMPFORMAT}. abort."
exit 1
;;
esac
if [ "${MUXSA_KVM2PNG_MD5_LAST_SLIDE}" ] ; then
if md5sum "${OUTFILE}" | \