restore script tweaks: set -x, shebang, sudo service