dangerzone/dangerzone-converter/scripts/pixels-to-pdf

17 lines
531 B
Bash
Executable file

#!/bin/sh
# Remove this warning by setting the host in /etc/hosts:
# sudo: unable to resolve host 8160b021d811: Temporary failure in name resolution
echo 127.0.0.1 $(hostname) >> /etc/hosts
# Do the conversion without root
/usr/bin/sudo OCR=$OCR OCR_LANGUAGE=$OCR_LANGUAGE -u user /usr/local/bin/pixels-to-pdf-unpriv
RETURN_CODE=$?
if [ $RETURN_CODE -ne 0 ]; then
echo ""
exit $RETURN_CODE
fi
# Move converted files into /safezone
/bin/mv /tmp/safe-output.pdf /safezone
/bin/mv /tmp/safe-output-compressed.pdf /safezone