-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer-setup
executable file
·43 lines (31 loc) · 1.02 KB
/
printer-setup
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
#!/bin/bash
function exiterr {
echo "-- $1. Exiting :("
exit 1
}
function addprinter {
cmd="lpadmin -p $1 -U 'hpi\\$user' -v smb://printsrv2013/$2 -P $ppddir/$ppdname"
eval $cmd || sudo sh -c "eval $cmd" || exiterr "Fehlgeschlagen Drucker $1 hinzuzufügen"
}
cd ~
ppdname="Canon-imageRunner-C3100.ppd"
ppddir=".local/share/ppd"
echo "Drucker Treiber wird gedownloadet ..."
if [ ! -f $ppddir/$ppdname ]; then
mkdir -p $ppddir
wget "http://tombeckmann.de/c/$ppdname" -O $ppddir/$ppdname
fi
echo "Konfiguration des Druckers ..."
read -p "HPI Benutzernamen eingeben: " user
#read -p "HPI Passwort eingeben: " -s password
#password=${password//@/%40}
#password=${password//:/\\:}
#password=${password//\(/\\\(}
#password=${password//\|/\\\|}
#password=${password//\$/\\\$}
echo "Drucker wird dem System hinzugefügt ..."
addprinter HPIPrinterColor color
addprinter HPIPrinterBlack BlackAndWhite
echo "Installation scheint erfolgreich gewesen zu sein"
which "gnome-control-center" &> /dev/null || exit 0
gnome-control-center printers &