From: Nicolas Boisselier Date: Mon, 1 May 2023 19:27:07 +0000 (+0200) Subject: remove old comment X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=eaebd24324623c89c2271d9ce716221a0f3b7d4e;p=nb.git remove old comment --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 92f26e24..2268611d 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -797,19 +797,14 @@ cron_d_install() { case "$1" in -t|--test) test=1; shift ;; esac fi - #echo "$#"; return -# NB 20.03.19 if [ $# -gt 4 -o $# = 0 ]; then if [ $# -gt 3 -o $# = 0 ]; then echo "$usage" 1>&2 && return 1 -# root 20.03.19 shell_help_noarg "$usage" "--help" && return 1 -# NB 20.03.19 #elif [ $# -eq 3 ]; then elif [ ! -e "$1" ]; then fname=$1; shift tmp="/tmp/cron_d_install.$$" trap "rm -f $tmp*" RETURN file="$tmp.cron" -# NB 29.03.19 # root 20.03.19 cat <<< "$1" > "$file"; shift echo "$1" > "$file"; shift exp=$1; shift @@ -839,46 +834,6 @@ cron_d_install() { # # Case 2 - crontab # - -#@f = map {chomp; $_} grep {!/^(@|#|\s*$)/} <>; -# NB 20.03.19 cron=$(perl -e ' -# NB 20.03.19 $diff = 0; -# NB 20.03.19 $e = shift @ARGV; -# NB 20.03.19 -# NB 20.03.19 @f = map {chomp; $_} grep {/^(\w+=|\*|\d+)/} <>; -# NB 20.03.19 for ($i=0;$i<@f;$i++) { -# NB 20.03.19 @F = split(" ",$f[$i]); -# NB 20.03.19 -# NB 20.03.19 next if $f[$i] !~ /^[\*\d]/ or @F<6; -# NB 20.03.19 if ($F[5] ne "root"){ -# NB 20.03.19 $_ = join(" ",@F[6..$#F]); -# NB 20.03.19 s/"/\\"/g; -# NB 20.03.19 @_=qq|su -l "$F[5]" -c "$_"|; -# NB 20.03.19 @F = (@F[0..4],"",@_); -# NB 20.03.19 }; -# NB 20.03.19 $f[$i] = join(" ",@F[0..4,6..$#F]); -# NB 20.03.19 } -# NB 20.03.19 0 and warn join("\n",@f); -# NB 20.03.19 %f = map {$_=>1} @f; -# NB 20.03.19 -# NB 20.03.19 @ARGV = ("crontab -l|"); -# NB 20.03.19 @c = map {chomp; $_} <>; -# NB 20.03.19 %c = map {$_=>1} @c; -# NB 20.03.19 -# NB 20.03.19 for (@c) { -# NB 20.03.19 0 and print STDERR "-$_\n" if $e and !$f{$_} and /$e/; -# NB 20.03.19 $diff=1 and next if $e and !$f{$_} and /$e/; -# NB 20.03.19 print "$_\n"; -# NB 20.03.19 } -# NB 20.03.19 -# NB 20.03.19 for (@f) { -# NB 20.03.19 $diff=2 and print "$_\n" if !$c{$_}; -# NB 20.03.19 } -# NB 20.03.19 -# NB 20.03.19 exit $diff ? 0 : 1; -# NB 20.03.19 ' "$exp" "$file" -# NB 20.03.19 ) - cron=$(cron_d2crontab "$exp" "$file") if [ "$test" = "1" ]; then printf '%s' "cron_d_install: crontab: $fname"