Last active
March 28, 2020 22:23
-
-
Save fonsp/43a83af9691b8e1e186f908950904f3e to your computer and use it in GitHub Desktop.
Printi client for the Raspberry Pi
This file contains hidden or 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 | |
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