Skip to content

Commit 149ccbd

Browse files
authored
[techsupport] Update show ip interface command (sonic-net#1562)
+ update 'show ip interface' command in tech support collection + fix unbound variable issue in case command times out
1 parent 0e84418 commit 149ccbd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

scripts/generate_dump

+10-7
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,20 @@ copy_from_docker() {
242242
local dstpath=$3
243243
local timeout_cmd="timeout --foreground ${TIMEOUT_MIN}m"
244244

245+
local touch_cmd="sudo docker exec -i ${docker} touch ${filename}"
246+
local cp_cmd="sudo docker cp ${docker}:${filename} ${dstpath}"
247+
245248
if $NOOP; then
246-
echo "${timeout_cmd} sudo docker exec -i ${docker} touch ${filename}"
247-
echo "${timeout_cmd} sudo docker cp ${docker}:${filename} ${dstpath}"
249+
echo "${timeout_cmd} ${touch_cmd}"
250+
echo "${timeout_cmd} ${cp_cmd}"
248251
else
249-
eval "${timeout_cmd} sudo docker exec -i ${docker} touch ${filename}"
252+
eval "${timeout_cmd} ${touch_cmd}"
250253
if [ $? -ne 0 ]; then
251-
echo "Command: $cmd timedout after ${TIMEOUT_MIN} minutes."
254+
echo "Command: $touch_cmd timedout after ${TIMEOUT_MIN} minutes."
252255
fi
253-
eval "${timeout_cmd} sudo docker cp ${docker}:${filename} ${dstpath}"
256+
eval "${timeout_cmd} ${cp_cmd}"
254257
if [ $? -ne 0 ]; then
255-
echo "Command: $cmd timedout after ${TIMEOUT_MIN} minutes."
258+
echo "Command: $cp_cmd timedout after ${TIMEOUT_MIN} minutes."
256259
fi
257260
fi
258261
end_t=$(date +%s%3N)
@@ -1084,7 +1087,7 @@ main() {
10841087
save_cmd "show interface status -d all" "interface.status"
10851088
save_cmd "show interface transceiver presence" "interface.xcvrs.presence"
10861089
save_cmd "show interface transceiver eeprom --dom" "interface.xcvrs.eeprom"
1087-
save_cmd_all_ns "show ip interface" "ip.interface"
1090+
save_cmd "show ip interface -d all" "ip.interface"
10881091

10891092
save_cmd "lldpctl" "lldpctl"
10901093
if [[ ( "$NUM_ASICS" > 1 ) ]]; then

0 commit comments

Comments
 (0)