Skip to content

Commit

Permalink
[techsupport] Update show ip interface command (#1562)
Browse files Browse the repository at this point in the history
+ update 'show ip interface' command in tech support collection
+ fix unbound variable issue in case command times out
  • Loading branch information
smaheshm authored Apr 15, 2021
1 parent 0e84418 commit 149ccbd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,20 @@ copy_from_docker() {
local dstpath=$3
local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"

local touch_cmd="sudo docker exec -i ${docker} touch ${filename}"
local cp_cmd="sudo docker cp ${docker}:${filename} ${dstpath}"

if $NOOP; then
echo "${timeout_cmd} sudo docker exec -i ${docker} touch ${filename}"
echo "${timeout_cmd} sudo docker cp ${docker}:${filename} ${dstpath}"
echo "${timeout_cmd} ${touch_cmd}"
echo "${timeout_cmd} ${cp_cmd}"
else
eval "${timeout_cmd} sudo docker exec -i ${docker} touch ${filename}"
eval "${timeout_cmd} ${touch_cmd}"
if [ $? -ne 0 ]; then
echo "Command: $cmd timedout after ${TIMEOUT_MIN} minutes."
echo "Command: $touch_cmd timedout after ${TIMEOUT_MIN} minutes."
fi
eval "${timeout_cmd} sudo docker cp ${docker}:${filename} ${dstpath}"
eval "${timeout_cmd} ${cp_cmd}"
if [ $? -ne 0 ]; then
echo "Command: $cmd timedout after ${TIMEOUT_MIN} minutes."
echo "Command: $cp_cmd timedout after ${TIMEOUT_MIN} minutes."
fi
fi
end_t=$(date +%s%3N)
Expand Down Expand Up @@ -1084,7 +1087,7 @@ main() {
save_cmd "show interface status -d all" "interface.status"
save_cmd "show interface transceiver presence" "interface.xcvrs.presence"
save_cmd "show interface transceiver eeprom --dom" "interface.xcvrs.eeprom"
save_cmd_all_ns "show ip interface" "ip.interface"
save_cmd "show ip interface -d all" "ip.interface"

save_cmd "lldpctl" "lldpctl"
if [[ ( "$NUM_ASICS" > 1 ) ]]; then
Expand Down

0 comments on commit 149ccbd

Please sign in to comment.