Created
November 27, 2015 12:06
-
-
Save sebastianwebber/ae33e474df1f2769e745 to your computer and use it in GitHub Desktop.
exemplo de scripts para rodar em servidor remoto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DEFAULT_USER=root | |
| DIR_SCRIPTS=/tmp | |
| function sync_scripts() { | |
| ssh $DEFAULT_USER@$1 mkdir -p $DIR_SCRIPTS > /dev/null 2>&1 | |
| rsync -a --partial teste.sh $DIR_SCRIPTS | |
| } | |
| function executa_script() { | |
| ssh $DEFAULT_USER@$1 $DIR_SCRIPTS/$2 | |
| } | |
| function roda_rotina() { | |
| sync_scripts $1 | |
| executa_script $1 teste.sh | |
| } | |
| for ip in $(seq 3 4); do | |
| roda_rotina 10.0.10.8$ip | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo super foda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment