Allow postscript to take args
$globals{postscript} can now contain a full command string including arguments. In order to facilitate this, the file executability check (-x) has been modified such that the first substring up to the first space (if it exists) is what is checked, rather than the whole string.
This commit is contained in:
parent
419716fd22
commit
e92c54f6f9
1 changed files with 2 additions and 1 deletions
|
@ -1209,9 +1209,10 @@ sub main {
|
||||||
|
|
||||||
sub runpostscript {
|
sub runpostscript {
|
||||||
my ($ip) = @_;
|
my ($ip) = @_;
|
||||||
|
my @postscript = split(/\s+/, $globals{postscript});
|
||||||
|
|
||||||
if (defined $globals{postscript}) {
|
if (defined $globals{postscript}) {
|
||||||
if (-x $globals{postscript}) {
|
if (-x $postscript[0]) {
|
||||||
system("$globals{postscript} $ip &");
|
system("$globals{postscript} $ip &");
|
||||||
} else {
|
} else {
|
||||||
warning("Can not execute post script: %s", $globals{postscript});
|
warning("Can not execute post script: %s", $globals{postscript});
|
||||||
|
|
Loading…
Reference in a new issue