From e92c54f6f91f2ab7d43c732b119c67bc694f4e90 Mon Sep 17 00:00:00 2001 From: {16/7} Date: Tue, 4 Apr 2023 14:58:39 -0700 Subject: [PATCH] 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. --- ddclient.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddclient.in b/ddclient.in index a4f4c12..e782cfc 100755 --- a/ddclient.in +++ b/ddclient.in @@ -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});