Refactor the code to generate zkServer.sh script