vzdump: transform hook script checks to post-if notation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-04-28 18:44:20 +02:00
parent a2cfe4ba6d
commit 6bf4c35dda

View File

@ -669,13 +669,8 @@ sub run_hook_script {
my $script = $opts->{script};
return if !$script;
if (!-f $script) {
die "Error: The hook script '$script' does not exist.\n";
}
if (!-x $script) {
die "Error: The hook script '$script' is not executable.\n";
}
die "Error: The hook script '$script' does not exist.\n" if ! -f $script;
die "Error: The hook script '$script' is not executable.\n" if ! -x $script;
my $cmd = [$script, $phase];