Rewrite of client.sh