Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions packaging/common/script-templates/script-common-header-last.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,12 @@ is_nova()
test "$PROJECT_TYPE" = "cfengine-nova" || test "$PROJECT_TYPE" = "cfengine-nova-hub"
}

INSTLOG=/var/log/CFEngineHub-Install.log
mkdir -p "$(dirname "$INSTLOG")"
CONSOLE=7
# Redirect most output to log file, but keep console around for custom output.
case "$SCRIPT_TYPE" in
pre*)
eval "exec $CONSOLE>&1 > $INSTLOG 2>&1"
;;
*)
eval "exec $CONSOLE>&1 >> $INSTLOG 2>&1"
;;
esac
echo "$SCRIPT_TYPE:"

# Output directly to console, bypassing log.
cf_console()
{
# Use subshell to prevent "set +x" from leaking out into the rest of the
# execution.
(
set +x
"$@" 1>&$CONSOLE 2>&$CONSOLE
)
"$@"
}

set -x