Update  sync.sh

not sure if this is really an improvement, now it does not need bash and does not use [ ]