Don't forget you'll have to restart splunk after an update due to the license agreement. So that script could probably make use of
sudo service splunk restart
...and follow the instructions to move forward, unless there's something you can append to the dkpg line and do more?
... View more