updated publish.sh - added signal handler