From b99ae5137471fad034dc7e98bc60cd2dc893b631 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 12 Jul 2005 16:34:44 +0000 Subject: r8384: merging clutter fixes from release branch (This used to be commit cbe74c09109dcfe93aa4af085920999ccbff34df) --- examples/scripts/printing/cups/smbaddprinter.pl | 41 +++++++++++++++++++++++++ examples/scripts/printing/cups/smbdelprinter.pl | 27 ++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 examples/scripts/printing/cups/smbaddprinter.pl create mode 100755 examples/scripts/printing/cups/smbdelprinter.pl (limited to 'examples/scripts/printing/cups') diff --git a/examples/scripts/printing/cups/smbaddprinter.pl b/examples/scripts/printing/cups/smbaddprinter.pl new file mode 100755 index 0000000000..557183140e --- /dev/null +++ b/examples/scripts/printing/cups/smbaddprinter.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl +## Add printer script for samba, APW, and cups +## Copyright (C) Jeff Hardy 2004 +## +## 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; +## ither 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, Inc., 675 Mass Ave, Cambridge, MA 02139, +## USA. + +@argv = @ARGV; + +# take in args +my $lpname=shift(@argv); # printer name +my $shname=shift(@argv); # share name -> used for CUPS queue name +my $portname=shift(@argv); # port name +my $drivername=shift(@argv); # driver name -> used for CUPS description +my $location=shift(@argv); # location -> used for CUPS device URI +my $win9x=shift(@argv); # win9x location + +#check for location syntax +#if no protocol specified... +if ($location !~ m#:/#){ + #assume an lpd printer + $location = "lpd://".$location; +} +#else, simply pass the URI on to the lpadmin command + +#run the cups lpadmin command to add the printer +system("/usr/sbin/lpadmin -p $shname -D \"$drivername\" -E -v $location"); + diff --git a/examples/scripts/printing/cups/smbdelprinter.pl b/examples/scripts/printing/cups/smbdelprinter.pl new file mode 100755 index 0000000000..30daf24b35 --- /dev/null +++ b/examples/scripts/printing/cups/smbdelprinter.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl +## Delete printer script for samba, APW, and cups +## Copyright (C) Gerald (Jerry) Carter 2004 +## +## 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; +## ither 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, Inc., 675 Mass Ave, Cambridge, MA 02139, +## USA. + +@argv = @ARGV; + +# take in args +my $lpname=shift(@argv); # printer name + +system("/usr/sbin/lpadmin -x $lpname"); + -- cgit From fbfaaa99937f97b3f1fd2e4fb4ce8ee6b4335f7f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:46:15 +0000 Subject: r23795: more v2->v3 conversion (This used to be commit c14aba93c06348a1f84fc1dd9791ff1159d22c4b) --- examples/scripts/printing/cups/smbaddprinter.pl | 2 +- examples/scripts/printing/cups/smbdelprinter.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/scripts/printing/cups') diff --git a/examples/scripts/printing/cups/smbaddprinter.pl b/examples/scripts/printing/cups/smbaddprinter.pl index 557183140e..4b26285d4c 100755 --- a/examples/scripts/printing/cups/smbaddprinter.pl +++ b/examples/scripts/printing/cups/smbaddprinter.pl @@ -5,7 +5,7 @@ ## 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; -## ither version 2 of the License, or (at your option) any +## Either version 3 of the License, or (at your option) any ## later version. ## ## This program is distributed in the hope that it will be useful, diff --git a/examples/scripts/printing/cups/smbdelprinter.pl b/examples/scripts/printing/cups/smbdelprinter.pl index 30daf24b35..2d245a65d5 100755 --- a/examples/scripts/printing/cups/smbdelprinter.pl +++ b/examples/scripts/printing/cups/smbdelprinter.pl @@ -5,7 +5,7 @@ ## 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; -## ither version 2 of the License, or (at your option) any +## Either version 3 of the License, or (at your option) any ## later version. ## ## This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- examples/scripts/printing/cups/smbaddprinter.pl | 4 +--- examples/scripts/printing/cups/smbdelprinter.pl | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'examples/scripts/printing/cups') diff --git a/examples/scripts/printing/cups/smbaddprinter.pl b/examples/scripts/printing/cups/smbaddprinter.pl index 4b26285d4c..aee2020bfc 100755 --- a/examples/scripts/printing/cups/smbaddprinter.pl +++ b/examples/scripts/printing/cups/smbaddprinter.pl @@ -14,9 +14,7 @@ ## 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, Inc., 675 Mass Ave, Cambridge, MA 02139, -## USA. +## License along with this program; if not, see . @argv = @ARGV; diff --git a/examples/scripts/printing/cups/smbdelprinter.pl b/examples/scripts/printing/cups/smbdelprinter.pl index 2d245a65d5..23adeb719c 100755 --- a/examples/scripts/printing/cups/smbdelprinter.pl +++ b/examples/scripts/printing/cups/smbdelprinter.pl @@ -14,9 +14,7 @@ ## 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, Inc., 675 Mass Ave, Cambridge, MA 02139, -## USA. +## License along with this program; if not, see . @argv = @ARGV; -- cgit