You could tweak the script so that you do the chown cmd before you write to the user-seed.conf and deploymentclient.conf. And then prefix the file creating echo cmds with sudo -u $SPLUNK_RUN_USER .
After chown, the splunk user should have write permissions in the splunk directories.
... View more