fix: improve link-restoring script
chore: fix file permissions