update script

Signed-off-by: Curno <lyf.curno@gmail.com>
fixed a memory leak bug.
change server connection to sync.

Signed-off-by: Curno <lyf.curno@gmail.com>