This is presumably for unattended download on cloud systems, but the script should alert the user first. Automatically shutting down a system when you download some data shouldn't be default behaviour. It's also not in the original Darknet script (https://github.com/pjreddie/darknet/blob/master/scripts/get_coco_dataset.sh).
Alternatively run `get_coco_dataset.sh && sudo shutdown`.