Skip to content

Commit

Permalink
use readonly variable $slog
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Sep 30, 2022
1 parent 771b794 commit 2937ff6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/fai-do-scripts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ do_script() {
# execute scripts and save their output in log files
# cfengine, shell, perl and expect scripts are known types
local shelldebug file filetype name
local -r slog=$LOGDIR/scripts.log

file=$1

Expand Down Expand Up @@ -127,19 +128,18 @@ do_script() {
case $filetype in
*"POSIX shell script"*|*"executable shell script"*|*"/bash script"*|*"Bourne shell script"*|*"Bourne-Again shell script"*|*"zsh script"*)
vecho "Executing $shelldebug shell: $file"
echo "===== shell: $file =====" >> $LOGDIR/scripts.log 2>&1
$shelldebug ./$file >> $LOGDIR/script.log 2>&1
echo "===== shell: $file =====" >> $slog 2>&1
$shelldebug ./$file >> $slog 2>&1
savemaxstatus $?
fc_check_status $file $exitcode | tee -a $LOGDIR/scripts.log
fc_check_status $file $exitcode | tee -a $slog
;;
*)
vecho "Executing: $file"
echo "===== $filetype $file =====" >> $LOGDIR/scripts.log 2>&1
./$file >> $LOGDIR/scripts.log 2>&1
echo "===== $filetype $file =====" >> $slog 2>&1
./$file >> $slog 2>&1
savemaxstatus $?
fc_check_status $file $exitcode | tee -a $LOGDIR/scripts.log
fc_check_status $file $exitcode | tee -a $slog
;;

esac
return
fi
Expand Down

0 comments on commit 2937ff6

Please sign in to comment.