Improve automount script