I want to write an automated post-installation script in Bash (called
post-install.sh, for instance). The script will automatically add and update repositories, install and update packages, edit config files, etc.
Now, if I execute this script, for instance with
sudo post-install.sh, will I only be prompted for a
sudo password once, or will I need to enter the
sudo password on each invocation of a command inside the script, that needs
sudo permission? In other words, do the commands inside the bash script 'inherit' the execution permissions, so to speak?
And, if they indeed do, is there still a possibility that the
sudo permissions will time out (if, for instance, a particular command takes long enough to exceed the
sudo timeout)? Or will the initial
sudo password entrance last for the complete duration of whole script?