diff options
author | Gerald Carter <jerry@samba.org> | 2004-03-16 19:44:40 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2004-03-16 19:44:40 +0000 |
commit | 107ddbdc6ed0632e54eeb597f6fafe82f4662a1a (patch) | |
tree | b068e04eb8fbe4f548bdbe3b66dbae6f8d09961a /packaging/SGI/sambalp | |
parent | 0e7efbe37114ea82ad36dec27765f9f82d32f461 (diff) | |
download | samba-107ddbdc6ed0632e54eeb597f6fafe82f4662a1a.tar.gz samba-107ddbdc6ed0632e54eeb597f6fafe82f4662a1a.tar.bz2 samba-107ddbdc6ed0632e54eeb597f6fafe82f4662a1a.zip |
BUG 748 - patch from jpeach@sgi.com (James Peach); relax arg parsing to sambalp script
(This used to be commit e2361da91f58e123c900f989b0afe94e93387a5d)
Diffstat (limited to 'packaging/SGI/sambalp')
-rw-r--r-- | packaging/SGI/sambalp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packaging/SGI/sambalp b/packaging/SGI/sambalp index 61e62215c9..27ca5165f9 100644 --- a/packaging/SGI/sambalp +++ b/packaging/SGI/sambalp @@ -50,8 +50,9 @@ $PSFIX = 1; # set to 0 if you don't want to run EOF $ENV{'PATH'} = join(':',@PATH); -if ($#ARGV < 3) { - print STDERR "usage: $PROG printer file user system\n"; + print "$#ARGV ".scalar(@ARGV)."\n"; +if (scalar(@ARGV) < 2) { + print STDERR "usage: $PROG printer file [user] [system]\n"; exit; } @@ -60,6 +61,9 @@ $file = $ARGV[1]; $user = $ARGV[2]; $system = $ARGV[3]; +$user = "nobody" unless($user); +$system = `hostname` unless($system); + open(LPSTAT,"/usr/bin/lpstat -t|") || die("Can't get printer list.\n"); @printers = (); while (<LPSTAT>) { |