Update kd_collect.sh

Added copyright and basic sanity check.