Advertisement
Guest User

OpenThinClient.org v1.0 custom script for scanner

a guest
Aug 12th, 2011
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.28 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. (
  4. sleep 1m
  5.  
  6. # Script to be placed in  openthinclient:/opt/openthinclient/server/default/data/nfs/root/custom/
  7.  
  8. # Source files on Canonical repository
  9. # http://launchpadlibrarian.net/24388634/libsane_1.0.19-23ubuntu7_i386.deb
  10. # http://launchpadlibrarian.net/56745533/libavahi-client3_0.6.23-4ubuntu4.1_i386.deb
  11. # http://launchpadlibrarian.net/56745540/libavahi-common3_0.6.23-4ubuntu4.1_i386.deb
  12. # http://launchpadlibrarian.net/20988589/libgphoto2-2_2.4.2-0ubuntu4_i386.deb
  13. # http://launchpadlibrarian.net/20988588/libgphoto2-port0_2.4.2-0ubuntu4_i386.deb
  14. # http://launchpadlibrarian.net/21261435/libltdl7_2.2.6a-1ubuntu1_i386.deb
  15. # http://launchpadlibrarian.net/24247001/libieee1284-3_0.2.11-5ubuntu1_i386.deb
  16. # http://launchpadlibrarian.net/24388633/sane-utils_1.0.19-23ubuntu7_i386.deb
  17. # http://launchpadlibrarian.net/19409061/update-inetd_4.31_all.deb
  18. # http://launchpadlibrarian.net/23516450/netbase_4.34ubuntu2_all.deb
  19.  
  20. # This version fixes a segfault on Ubuntu
  21. # See http://colas.nahaboo.net/Hacks/ScanButtond
  22. # http://colaz.net/files/ubuntu/scanbuttond_0.2.3-7_i386.deb
  23.  
  24. LOCALREPO=linux
  25.  
  26. # Packages have to be installed in that order for dependancies
  27. for p in \
  28. libieee1284-3_0.2.11-5ubuntu1_i386.deb \
  29. libltdl7_2.2.6a-1ubuntu1_i386.deb \
  30. libavahi-common3_0.6.23-4ubuntu4.1_i386.deb \
  31. libavahi-client3_0.6.23-4ubuntu4.1_i386.deb \
  32. libgphoto2-port0_2.4.2-0ubuntu4_i386.deb \
  33. libgphoto2-2_2.4.2-0ubuntu4_i386.deb \
  34. libsane_1.0.19-23ubuntu7_i386.deb \
  35. netbase_4.34ubuntu2_all.deb \
  36. update-inetd_4.31_all.deb \
  37. sane-utils_1.0.19-23ubuntu7_i386.deb \
  38. scanbuttond_0.2.3-7_i386.deb
  39. do
  40.         wget -O /tmp/$p http://$LOCALREPO/openthinclient/scanner/$p
  41.         dpkg -i /tmp/$p
  42. done
  43.  
  44. # What happens when a button from the scanner is pressed !
  45. # Here the script can be configured according to the hostname for example
  46. wget -O /etc/scanbuttond/buttonpressed.sh http://$LOCALREPO/openthinclient/scanner/buttonpressed.sh
  47.  
  48.  
  49. # 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"
  50. # We populate the .ssh/known_hosts file with the following:
  51. echo "xxx ssh-rsa xxxx
  52. xxx ssh-rsa xxx" > /home/tcos/.ssh/known_hosts
  53.  
  54. mkdir /root/.ssh
  55. rsync -a /home/tcos/.ssh /root/
  56.  
  57. scanbuttond
  58.  
  59. ) &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement