#!/bin/sh
(
sleep 1m
# Script to be placed in openthinclient:/opt/openthinclient/server/default/data/nfs/root/custom/
# Source files on Canonical repository
# http://launchpadlibrarian.net/24388634/libsane_1.0.19-23ubuntu7_i386.deb
# http://launchpadlibrarian.net/56745533/libavahi-client3_0.6.23-4ubuntu4.1_i386.deb
# http://launchpadlibrarian.net/56745540/libavahi-common3_0.6.23-4ubuntu4.1_i386.deb
# http://launchpadlibrarian.net/20988589/libgphoto2-2_2.4.2-0ubuntu4_i386.deb
# http://launchpadlibrarian.net/20988588/libgphoto2-port0_2.4.2-0ubuntu4_i386.deb
# http://launchpadlibrarian.net/21261435/libltdl7_2.2.6a-1ubuntu1_i386.deb
# http://launchpadlibrarian.net/24247001/libieee1284-3_0.2.11-5ubuntu1_i386.deb
# http://launchpadlibrarian.net/24388633/sane-utils_1.0.19-23ubuntu7_i386.deb
# http://launchpadlibrarian.net/19409061/update-inetd_4.31_all.deb
# http://launchpadlibrarian.net/23516450/netbase_4.34ubuntu2_all.deb
# This version fixes a segfault on Ubuntu
# See http://colas.nahaboo.net/Hacks/ScanButtond
# http://colaz.net/files/ubuntu/scanbuttond_0.2.3-7_i386.deb
LOCALREPO=linux
# Packages have to be installed in that order for dependancies
for p in \
libieee1284-3_0.2.11-5ubuntu1_i386.deb \
libltdl7_2.2.6a-1ubuntu1_i386.deb \
libavahi-common3_0.6.23-4ubuntu4.1_i386.deb \
libavahi-client3_0.6.23-4ubuntu4.1_i386.deb \
libgphoto2-port0_2.4.2-0ubuntu4_i386.deb \
libgphoto2-2_2.4.2-0ubuntu4_i386.deb \
libsane_1.0.19-23ubuntu7_i386.deb \
netbase_4.34ubuntu2_all.deb \
update-inetd_4.31_all.deb \
sane-utils_1.0.19-23ubuntu7_i386.deb \
scanbuttond_0.2.3-7_i386.deb
do
wget -O /tmp/$p http://$LOCALREPO/openthinclient/scanner/$p
dpkg -i /tmp/$p
done
# What happens when a button from the scanner is pressed !
# Here the script can be configured according to the hostname for example
wget -O /etc/scanbuttond/buttonpressed.sh http://$LOCALREPO/openthinclient/scanner/buttonpressed.sh
# Buttonpressed.sh connects to a linux server using RSA Keys, but if the host is not known, it will just hang, waiting for the user to type "yes"
# We populate the .ssh/known_hosts file with the following:
echo "xxx ssh-rsa xxxx
xxx ssh-rsa xxx" > /home/tcos/.ssh/known_hosts
mkdir /root/.ssh
rsync -a /home/tcos/.ssh /root/
scanbuttond
) &