Use exit({:shutdown, int}) to signal shell status