July 12, 2014

[SOLVED]Google Cloud Print and the Raspberry Pi

# sudo apt-get update
# sudo apt-get install build-essential python-dev libcups2-dev

# install cups on raspberry http://www.howtogeek.com/169679/how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer/

# sudo apt-get install python-setuptools
# sudo easy_install pip

# sudo pip install cloudprint pycups

# cloudprint

# sudo cp .cloudprintauth .cloudprintauth.sasl /root

# sudo nano /etc/init.d/gcloudprint

Paste
#! /bin/bash
# /etc/init.d/gcloudprint

### BEGIN INIT INFO
# Provides:        cloudprint
# Required-Start:    $remote_fs $syslog
# Required-Stop:    $remote_fs $syslog
# Default-Start:    2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:    System service to run cloud print connector
# Description:        System service to run cloud print connector
### END INIT INFO

# Carry out start/stop/restart actions
case "$1" in
    start)
        echo "Starting cloud print connector"
        sudo -u pi cloudprint >> /var/log/cloudprint.log &
        ;;
    stop)
        echo "Stopping cloud print connector"
        killall cloudprint
        ;;
    restart)
        echo "Restart connector"
        echo "Stopping cloud print connector"
        killall cloudprint
        echo "Starting cloud print connector"
        sudo -u pi cloudprint >> /var/log/cloudprint.log &
        ;;
    *)
        echo "Usage: /etc/init.d/gcloudprint {start|stop|restart}"
        exit 1
        ;;
esac

exit 0


# sudo chmod +x /etc/init.d/gcloudprint
# sudo update-rc.d gcloudprint default




Sourcehttp://blog.onslow-web.co.uk/?p=71

No comments:

Post a Comment