Skip to content

Instantly share code, notes, and snippets.

@fonsp
Last active March 28, 2020 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonsp/43a83af9691b8e1e186f908950904f3e to your computer and use it in GitHub Desktop.
Save fonsp/43a83af9691b8e1e186f908950904f3e to your computer and use it in GitHub Desktop.
Printi client for the Raspberry Pi
#!/bin/bash
cd /tmp/
! mkdir printi
cd printi
if [ -z "$1" ]
then
echo "Give a printi name as argument to this script."
exit
fi
while true
do
if (wget --content-disposition --trust-server-names api.printi.me/nextinqueue/$1)
then
downloadedfile=$(ls)
cat $downloadedfile | sudo tee /dev/usb/lp0
echo "\n" | sudo tee /dev/usb/lp0
rm $downloadedfile
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment