Skip to content

Instantly share code, notes, and snippets.

@ftkro
Created July 25, 2014 02:42
Show Gist options
  • Select an option

  • Save ftkro/cdfc0c6211c1a58a856d to your computer and use it in GitHub Desktop.

Select an option

Save ftkro/cdfc0c6211c1a58a856d to your computer and use it in GitHub Desktop.
Asteriskのファクシミリを容易に送れるTUI?なスクリプト
#!/bin/sh
file=faxout.tif
if [ -e $file ]; then
echo "$file Found, Do Send fax."
echo -n "Please input send fax number: "
read faxnum
if expr "$faxnum" : '[0-9]*' > /dev/null ; then
echo 'OK' > /dev/null
else
echo "This is not number. Please try agein."
exit 1
fi
while true; do
echo -n "Send number is ${faxnum} is this correct? [y/N]: "
read confirm
case $confirm in
y) echo "OK,It will Start within 3seconds."
echo "Note: You need Administrator Password"
sudo asterisk -rx "originate SIP/${faxnum}@brastel extension send@fax-tx"
if [ "$?" -eq 0 ]; then
echo 'Send Fax Was Successed.'
echo 'Now Removing faxout.tif'
rm -r faxout.tif
exit 0
else
echo 'Send Fax Was Failed.'
echo 'Please check it'
exit 1
fi
break
;;
*) echo "Aborting."
exit 1
break
;;
esac
done
else
echo "$file not found."
echo "If you have tif file, please rename faxout.tif"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment