Skip to content

Commit

Permalink
scripts: Simpify main function in cc-collect-data.sh
Browse files Browse the repository at this point in the history
Add a "show_runtime" function to simplify main.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 25, 2017
1 parent 08ed990 commit 53bd495
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions data/cc-collect-data.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,21 @@ show_meta()
msg "Running \`$script_name\` version \`$script_version\` at \`$date\`."
}

main()
show_runtime()
{
[ $(id -u) -eq 0 ] || die "Need to run as root"

show_meta

msg "Runtime is \`$runtime\`"
msg "Runtime is \`$runtime\`."

cmd="cc-env"
heading "\`$cmd\`"
run_cmd_and_show_quoted_output "$runtime $cmd"
}

main()
{
[ $(id -u) -eq 0 ] || die "Need to run as root"

show_meta
show_runtime
show_runtime_configs
show_runtime_log_details
show_container_mgr_details
Expand Down

0 comments on commit 53bd495

Please sign in to comment.