ubuntuusers.de

iP3300.sh

Autor:
dervinz
Datum:
15. August 2008 00:37
Code:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#/bin/sh
#   iP3300.sh - v1.0 - 2007-12-30
#   Installationsskript für Canon Pixma iP3300 Drucker unter Debian
#   Script for installation of Canon iP3300 printers under Debian
#***************************************************************************
#   Copyright (C) 2007-2008 by Vinzenz Vietzke
#   vinz@v1nz.de / http://www.v1nz.de
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the
#   Free Software Foundation
#   51 Franklin Street, Fifth Floor
#   Boston, MA 02110-1301 USA
#***************************************************************************
printf 'Prüfe Systemsprache / Checking system language...\n'
syslang=`printenv LANG`
case $syslang in
de*)
printf 'Systemsprache '"$syslang"'\n\n';
	if test $( id | awk -F'[=(]' '{print $2}'; ) -eq "0";
	then printf 'LOS GEHTS!\nDu bist root - alles klar!\n';
		mkdir -v /tmp/iP3300
		printf 'Installiere benötigte Pakete mit APT-GET...\n'
			apt-get -qq update
			apt-get -qq install libxml1 libglade0 libpng3 libtiff4 && apt-get -qq install alien wget
		cd /tmp/iP3300/
		clear
		printf 'Hole Treiber als RPM-Pakete von www.v1nz.de...\n'
			wget -v http://www.v1nz.de/downloads/ip3300/cnijfilter-common-2.70-1.i386.rpm
			wget -v http://www.v1nz.de/downloads/ip3300/cnijfilter-ip3300-2.70-1.i386.rpm
		clear
		printf 'Konvertiere RPMs mit alien ins Debian DEB-Format...\n'
			alien -d cnijfilter-common-2.70-1.i386.rpm
			alien -d --scripts cnijfilter-ip3300-2.70-1.i386.rpm
		clear
		printf 'Installiere konvertierte DEB-Pakete...\n'
			dpkg -i cnijfilter-common_2.70-2_i386.deb && dpkg -i cnijfilter-ip3300_2.70-2_i386.deb
		clear
		printf 'Setze Symlinks...\n'
			cd /usr/local/bin
			ldd cifip3300
			cd /usr/lib
			ln -s libtiff.so.4 libtiff.so.3
			ldconfig
		clear
		printf 'Hole vorkonfigurierte PPD-Datei von www.v1nz.de...\n'
			cd /tmp/iP3300
			wget -v http://www.v1nz.de/downloads/ip3300/canonip3300.ppd
		clear
		printf 'Kopiere vorkonfigurierte PPD-Datei in das CUPS-Verzeichnis...\n'
			mkdir /usr/share/cups/model
			mv -v /tmp/iP3300/canonip3300.ppd /usr/share/cups/model/
		clear
		printf 'Lösche Installationsdaten...\n'
			cd ..
			rm -Rfv iP3300/
		clear
		printf 'FERTIG!\nTreiber für Canon Pixma iP3300 erfolgreich installiert.\nDer Drucker kann nun aktiviert und genutzt werden!\n\nViel Spaß!\n'
	else printf $USER', du benötigst root-Rechte um den Treiber zu installieren!\nVerwende "su root" oder "sudo su" um dieser zu bekommen!\n';
	fi
;;
!=de*)
printf 'System language '"$syslang"'\n\n'; 
	if test $( id | awk -F'[=(]' '{print $2}'; ) -eq "0"; 
	then printf 'LETS GO!\nYou are root - everything allright!\n';  
		mkdir -v /tmp/iP3300
		printf 'Installing needed packages via APT-GET...\n'
			apt-get -qq update
			apt-get -qq install libxml1 libglade0 libpng3 libtiff4 && apt-get -qq install alien wget
		cd /tmp/iP3300/
		clear
		printf 'Fetching RPM-packaged driver from www.v1nz.de...\n'
			wget -v http://www.v1nz.de/downloads/ip3300/cnijfilter-common-2.70-1.i386.rpm
			wget -v http://www.v1nz.de/downloads/ip3300/cnijfilter-ip3300-2.70-1.i386.rpm
		clear
		printf 'Converting RPMs to Debian DEB-format using alien...\n'
			alien -d cnijfilter-common-2.70-1.i386.rpm
			alien -d --scripts cnijfilter-ip3300-2.70-1.i386.rpm
		clear
		printf 'Installing converted DEB packages...\n'
			dpkg -i cnijfilter-common_2.70-2_i386.deb && dpkg -i cnijfilter-ip3300_2.70-2_i386.deb
		clear
		printf 'Setting symlinks...\n'
			cd /usr/local/bin
			ldd cifip3300
			cd /usr/lib
			ln -s libtiff.so.4 libtiff.so.3
			ldconfig
		clear
		printf 'Fetching preconfigured PPD file from www.v1nz.de...\n'
			cd /tmp/iP3300
			wget -v http://www.v1nz.de/downloads/ip3300/canonip3300.ppd
		clear
		printf 'Copying preconfigured PPD file to CUPS folder...\n'
			mkdir /usr/share/cups/model
			mv -v /tmp/iP3300/canonip3300.ppd /usr/share/cups/model/
		clear
		printf 'Deleting installation data...\n'
			cd ..
			rm -Rfv iP3300/
		clear
		printf 'DONE!\nDriver for Canon Pixma iP3300 successfully installed.\nThe Printer may now be activated and used!\n\nHave fun!\n'
	else clear && printf $USER', you need root-rights for installing the driver!\n\nUse "su root" or "sudo su" for getting them!\n';
	fi
;;
esac