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:
{16/7} 2023-04-04 14:58:39 -07:00
parent 419716fd22
commit e92c54f6f9

View file

@ -1209,9 +1209,10 @@ sub main {
sub runpostscript {
my ($ip) = @_;
my @postscript = split(/\s+/, $globals{postscript});
if (defined $globals{postscript}) {
if (-x $globals{postscript}) {
if (-x $postscript[0]) {
system("$globals{postscript} $ip &");
} else {
warning("Can not execute post script: %s", $globals{postscript});