From c56262b12cad8e4e9bd5760c0648b5f6da879eec Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 1 May 2023 21:24:03 +0200 Subject: [PATCH] remove cron if no file or stdin --- bin/cron_d2crontab | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cron_d2crontab b/bin/cron_d2crontab index 9f826532..ea1b7cce 100755 --- a/bin/cron_d2crontab +++ b/bin/cron_d2crontab @@ -38,7 +38,12 @@ my $exp = shift @ARGV; # # Parse src file # -my @src = map {chomp; $_} grep {/^(\w+=|\*|\d+|@)/} <>; +#die @ARGV; +#warn (-t ? 'YES' : 'NO'); +my @src = (@ARGV or !-t) + ? ( map {chomp; $_} grep {/^(\w+=|\*|\d+|@)/} <> ) + : () +; for (my $i=0;$i<@src;$i++) { -- 2.47.3