Skip to content

Instantly share code, notes, and snippets.

@mklooss
Created April 16, 2018 13:42
Show Gist options
  • Save mklooss/3153e656d464441e55a2647f5701954f to your computer and use it in GitHub Desktop.
Save mklooss/3153e656d464441e55a2647f5701954f to your computer and use it in GitHub Desktop.
pssh Samples
#!/bin/bash
parallel-ssh -i -h pssh.txt "sudo DEBIAN_FRONTEND=noninteractive apt-get update"
parallel-ssh -i -h pssh.txt "sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/nginx && sudo /etc/init.d/nginx restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php5-fpm && sudo /etc/init.d/php5-fpm restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php5.6-fpm && sudo /etc/init.d/php5.6-fpm restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php7.0-fpm && sudo /etc/init.d/php7.0-fpm restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php7.1-fpm && sudo /etc/init.d/php7.1-fpm restart"
parallel-ssh -i -h pssh.txt "test -f /etc/init.d/php7.2-fpm && sudo /etc/init.d/php7.2-fpm restart"
user@hostname1
user@hostname2
user@hostname3
user@hostname4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment