I have many servers and I am writing a script which allows me to upload it to the servers and perform some instructions like to install a program, etc. I use something like:
sudo ssh -T $host <<-EOF
wget -c $path/$file
Where 'file' is a shell code with the proper instructions. Is there any possibility to scp file to a server and run it automatically since it's been uploaded? This will simplify and speed up the script's work cause I have too many servers: 500 or so.