Update nms.sh to be compatible with other systems.

Signed-off-by: winton.liu <newtonliuwen@gmail.com>