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
7 changes: 4 additions & 3 deletions cmc
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ config_control_path() {
# Extract ControlPath from SSH config
local _result _result_count
_result=$(awk \
'tolower($1) ~ /^controlpath$/ {
'/^ *#/ || /^ *$/{next}
tolower($1) ~ /^controlpath$/ {
if ( tolower($2) !~ /^none$/ ) {
print $2
}
}' ${SSH_CONFIG})
}' ${SSH_CONFIG} | sort -u)
if [[ -n "${_result}" ]]
then
# Only a single ControlPath should be specified
_result_count=$(echo "${_result}" | sort -u | wc -l)
_result_count=$(echo "${_result}" | wc -l)
if (( _result_count > 1 ))
then
error_exit "multiple ControlPaths specified: ${_result}"
Expand Down