-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprinterSetup.sh
executable file
·293 lines (276 loc) · 20.9 KB
/
printerSetup.sh
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#!/bin/bash
# Georgia Tech Printer Setup Script
# Compatible with most Linux-based systems
# Requires a recent version of CUPS
# Written by Siddu Duddikunta <[email protected]>
# Maintained by the Gatech Linux Users Group
# https://github.com/LUGatGT/printer-setup
fail()
{
echo '[FAILED]'
echo 'A log is available at /tmp/printer_install/log.'
exit 1
}
LPADMIN=$(which lpadmin)
RAR=$(which unrar)
WGET=$(which wget)
DIALOG=$(which dialog)
CUPSENABLE=$(which cupsenable)
CUPSACCEPT=$(which cupsaccept)
UNZIP=$(which unzip)
if [ -z $LPADMIN ]; then
echo "error: no lpadmin found (is cups installed?)"
exit 1
fi
if [ -z $RAR ]; then
echo "error: no unrar found; please install it"
exit 1
fi
if [ -z $UNZIP ]; then
echo "error: no unzip found; please install it"
exit 1
fi
if [ -z $WGET ]; then
echo "error: no wget found; please install it"
exit 1
fi
while true; do
GT_USER=$($DIALOG --inputbox "GT username:" 8 40 2>&1 >/dev/tty)
STATUS=$?
clear
if [ $STATUS -ne 0 ]; then
echo "Canceled"
exit 1
fi
if [ -n "$GT_USER" ]; then
break;
fi
done
cmd=($DIALOG --separate-output --checklist "Select printers to install:" 22 76 16)
options=(1 "Black Standard" on
2 "Black Finish" on
3 "CentralPS" on
4 "Library Color" on
5 "BME Color" on
6 "CE Color" on
7 "CoA Color" on
8 "CoB Color" on
9 "Klaus 1446 Color" on
10 "Klaus 1448 Color" on
11 "MRDC Color" on
12 "Multimedia Studio Color" on
13 "Student Center Color" on
14 "Van Leer 448 Color" on)
INSTALL=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
mkdir -p /tmp/printer_install
cd /tmp/printer_install
echo "Please enter your root password if requested so we can interact with CUPS."
sudo true || fail
echo
echo "==========GT Printer Installation Script Log==========" >> /tmp/printer_install/log
echo "Selections: $INSTALL" >> /tmp/printer_install/log
echo -n "Date/Time: " >> /tmp/printer_install/log
echo `date` >> /tmp/printer_install/log
echo >> /tmp/printer_install/log
for PRINTER in $INSTALL
do
case $PRINTER in
1)
echo "Installing Black Standard..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/xr5550dn.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-5550/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&contentId=100080" -O 5550_PPD_Drivers_en-us.exe >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $RAR e 5550_PPD_Drivers_en-us.exe xr5550dn.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTBlackStandard -v "lpd://[email protected]/laptop_black_xerox5550" -L "GT Campus" -D "GT standard black printer; no staple/hole punch" -P /tmp/printer_install/xr5550dn.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTBlackStandard -o media=na_letter_8.5x11in -o PageSize=Letter -o InstalledMemory=512Meg -o XRXOptionFeatureSet=DN -o XRXOptionTrays=ThreeExtraTrays -o XRXOptionHD=False -o XRXOptionDuplex=True -o XRXOptionPunch=False -o XRXOptionFinisher=False >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTBlackStandard >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTBlackStandard >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
2)
echo "Installing Black Finish..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/xr5550dn.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-5550/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&contentId=100080" -O 5550_PPD_Drivers_en-us.exe >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $RAR e 5550_PPD_Drivers_en-us.exe xr5550dn.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTBlackFinish -v "lpd://[email protected]/laptop_finish_xerox5550F" -L "GT Campus" -D "GT finish black printer; with staple/hole punch" -P /tmp/printer_install/xr5550dn.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTBlackFinish -o media=na_letter_8.5x11in -o PageSize=Letter -o InstalledMemory=512Meg -o XRXOptionFeatureSet=DN -o XRXOptionTrays=ThreeExtraTrays -o XRXOptionHD=False -o XRXOptionDuplex=True -o XRXOptionPunch=US_Punch -o XRXOptionFinisher=True >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTBlackFinish >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTBlackFinish >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
3)
echo "Installing CentralPS..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/heidelberg9110.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "https://www.openprinting.org/ppd-o-matic.php?driver=Postscript&printer=Heidelberg-Digimaster_9110&show=0" -O heidelberg9110.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTCentralPS -v "lpd://[email protected]/laptop_centralps" -L "GT Printing Services" -D "GT central printing service" -P /tmp/printer_install/heidelberg9110.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $CUPSENABLE GTCentralPS >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTCentralPS >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
4)
echo "Installing Library Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/xr7500dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7500/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&contentId=116895" -O 7500_PPD_Driver_en-US.exe >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $RAR e 7500_PPD_Driver_en-US.exe xr7500dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTLibraryColor -v "lpd://[email protected]/laptop_color_library" -L "GT Library" -D "GT library color printer" -P /tmp/printer_install/xr7500dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTLibraryColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTLibraryColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTLibraryColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
5)
echo "Installing BME Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/xr7500dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7500/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&contentId=116895" -O 7500_PPD_Driver_en-US.exe >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $RAR e 7500_PPD_Driver_en-US.exe xr7500dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTBMEColor -v "lpd://[email protected]/laptop_color_bme" -L "Biomedical Engineering Building" -D "GT BME color printer" -P /tmp/printer_install/xr7500dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTBMEColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTBMEColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTBMEColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
6)
echo "Installing CE Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7400/file-redirect/enus.html?operatingSystem=linux&fileLanguage=en&contentId=61334" -O LinuxCupsPrinterPkg.tar.gz >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && tar xf LinuxCupsPrinterPkg.tar.gz LinuxCupsPrinterPkg/xrx7400dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTCEColor -v "lpd://[email protected]/laptop_color_ce" -L "School of Civil and Environmental Engineering" -D "GT CE color printer" -P /tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTCEColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTCEColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTCEColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
7)
echo "Installing CoA Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7400/file-redirect/enus.html?operatingSystem=linux&fileLanguage=en&contentId=61334" -O LinuxCupsPrinterPkg.tar.gz >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && tar xf LinuxCupsPrinterPkg.tar.gz LinuxCupsPrinterPkg/xrx7400dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTCoAColor -v "lpd://[email protected]/laptop_color_coa" -L "College of Architecture" -D "GT CoA color printer" -P /tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTCoAColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTCoAColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTCoAColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
8)
echo "Installing CoB Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/XeroxWorkCentre7545.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/workcentre-7545-7556/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&&associatedProduct=XRIP_WC7525_base&contentId=119525" -O English.5.250.0.zip >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $UNZIP English.5.250.0.zip XeroxWorkCentre7545.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTCoBColor -v "lpd://[email protected]/laptop_color_cob" -L "College of Business" -D "GT CoB color printer" -P /tmp/printer_install/XeroxWorkCentre7545.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTCoBColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTCoBColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTCoBColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
9)
echo "Installing Klaus 1446 Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7400/file-redirect/enus.html?operatingSystem=linux&fileLanguage=en&contentId=61334" -O LinuxCupsPrinterPkg.tar.gz >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && tar xf LinuxCupsPrinterPkg.tar.gz LinuxCupsPrinterPkg/xrx7400dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTKlaus1446Color -v "lpd://[email protected]/laptop_color_ece_K1446" -L "Klaus Advanced Computing Building 1446" -D "GT Klaus 1446 color printer" -P /tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTKlaus1446Color -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTKlaus1446Color >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTKlaus1446Color >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
10)
echo "Installing Klaus 1448 Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/dl5110cn.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "https://gist.githubusercontent.com/pwyliu/7274079/raw/14ec0058b77b667141669248700a82a1a31f504d/dl5110cn.ppd" -O dl5110cn.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTKlaus1448Color -v "lpd://[email protected]/laptop_color_ece_K1448" -L "Klaus Advanced Computing Building 1448" -D "GT Klaus 1448 color printer" -P /tmp/printer_install/dl5110cn.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTKlaus1448Color -o media=na_letter_8.5x11in >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTKlaus1448Color >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTKlaus1448Color >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
11)
echo "Installing MRDC Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7400/file-redirect/enus.html?operatingSystem=linux&fileLanguage=en&contentId=61334" -O LinuxCupsPrinterPkg.tar.gz >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && tar xf LinuxCupsPrinterPkg.tar.gz LinuxCupsPrinterPkg/xrx7400dt.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTMRDCColor -v "lpd://[email protected]/laptop_color_mrdc" -L "Manufacturing Related Disciplines Complex" -D "GT MRDC color printer" -P /tmp/printer_install/LinuxCupsPrinterPkg/xrx7400dt.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTMRDCColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTMRDCColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTMRDCColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
12)
echo "Installing Multimedia Studio Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/LinuxCupsPrinterPkg/xrx7760dx.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/phaser-7400/file-redirect/enus.html?operatingSystem=linux&fileLanguage=en&contentId=61334" -O LinuxCupsPrinterPkg.tar.gz >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && tar xf LinuxCupsPrinterPkg.tar.gz LinuxCupsPrinterPkg/xrx7760dx.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTMStudioColor -v "lpd://[email protected]/laptop_color_mstudio" -L "Library Multimedia Studio" -D "GT mutlimedia studio color printer" -P /tmp/printer_install/LinuxCupsPrinterPkg/xrx7760dx.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTMStudioColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTMStudioColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTMStudioColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
13)
echo "Installing Student Center Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/xrx7775.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "http://www.support.xerox.com/support/workcentre-7755-7765-7775/file-redirect/enus.html?operatingSystem=win81&fileLanguage=en&&associatedProduct=XRIP_WC7755_Base&contentId=107530" -O WC7755_Win-PPD_1.0.18_English.zip >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Extracting driver...\\t" && $UNZIP WC7755_Win-PPD_1.0.18_English.zip xrx7775.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTStudentCenterColor -v "lpd://[email protected]/laptop_color_studentcenter" -L "Student Center" -D "GT student center color printer" -P /tmp/printer_install/xrx7775.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTStudentCenterColor -o media=na_letter_8.5x11in -o PageSize=Letter >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTStudentCenterColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTStudentCenterColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
14)
echo "Installing Van Leer 448 Color..." | tee -a /tmp/printer_install/log
if [ ! -f "/tmp/printer_install/dl5110cn.ppd" ]; then
echo -n -e "Downloading driver...\\t" && $WGET "https://gist.githubusercontent.com/pwyliu/7274079/raw/14ec0058b77b667141669248700a82a1a31f504d/dl5110cn.ppd" -O dl5110cn.ppd >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
fi
echo -n -e "Installing to CUPS...\\t" && sudo $LPADMIN -E -p GTVanLeerColor -v "lpd://[email protected]/laptop_color_ece_VL448" -L "Van Leer 448" -D "GT Van Leer 448 color printer" -P /tmp/printer_install/dl5110cn.ppd -o printer-is-shared=false >>/tmp/printer_install/log 2>&1 || fail && echo "[OK]"
echo -n -e "Setting options...\\t"
sudo $LPADMIN -p GTVanLeerColor -o media=na_letter_8.5x11in >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSENABLE GTVanLeerColor >>/tmp/printer_install/log 2>&1 || fail
sudo $CUPSACCEPT GTVanLeerColor >>/tmp/printer_install/log 2>&1 || fail
echo "[OK]"
echo
;;
esac
done
echo "All done! A log is available at /tmp/printer_install/log."
echo "You can print from any application, including GUI applications like Firefox/Chrome and Document Viewer."
echo "To print from the command line, use: lpr -P (PrinterName) (filename)."
echo "You may view installed printers using your browser at http://localhost:631/."