Skip to content

Instantly share code, notes, and snippets.

@H3wastooshort
Last active November 21, 2018 14:45
Show Gist options
  • Save H3wastooshort/4168b90ff1be41d91955185515936076 to your computer and use it in GitHub Desktop.
Save H3wastooshort/4168b90ff1be41d91955185515936076 to your computer and use it in GitHub Desktop.
Simple samba fax server
#!/bin/bash
#is dependent on [efax,inotify-tools,beep] and your samba server of choice
#===HOW2INSTALL===#
#make the fax dir "sudo chmod +rw"
#make the sript "sudo chmod +rx" and run it as sudo!
#
#===HOW2USE===#
#write number in a number.txt file (create and leave it BEFORE starting the script) and copy your fax (like txt or pbm) into the folder.
#DONE
#
while true;do
MONITORDIR="/faxsend"
inotifywait -m -r -e create --format '%w%f' "${MONITORDIR}" | while read NEWFILE
do
beep -f 2000
echo "starting..."
sleep 10
beep -f 1000
efax -t `echo $(cat $MONITORDIR/number.txt)` $NEWFILE
rm $NEWFILE
beep -f 500
break
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment