Adapt script to rename and non-root sudo