Update advd.sh

Typo in Incomplete download purge segment code. Corrected errors on exit codes. Silly me.