Created
February 26, 2021 06:48
-
-
Save Phill93/ce2f6daa99efc91287dab70f88e7f9ae to your computer and use it in GitHub Desktop.
Scan Script for scanbd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o xtrace | |
scan_dir=/external/scan | |
datetime=`date +"%Y-%m-%d_%H-%M-%S"` | |
filename=$SCANBD_ACTION_$SCANBD_FUNCTION-$datetime | |
cd /tmp | |
scanimage --source="ADF Duplex" -d $SCANBD_DEVICE --format=tiff --resolution 600 --mode Color --page-width=210 --page-height=297 --batch=${filename}_p%04d.tiff | |
tiffcp ${filename}_p*.tiff $filename.tiff | |
rm -f ${filename}_p*.tiff | |
tiff2pdf -j -p A4 -o $scan_dir/$filename.pdf $filename.tiff | |
rm -f $filename.tiff | |
mv $scan_dir/$filename.pdf $scan_dir/ready/$filename.pdf | |
chmod 660 $scan_dir/ready/$filename.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment