1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# Bu script community A-B sunuculari arasinda gecis icin kullaniliyor. # Ornek: # bash /bin/community a (b yi aktif etmek icin) # bash /bin/community b (a yi aktif etmek icin) # omeroner #!/bin/bash ## node lists a="10.10.141.10 10.10.141.11 10.10.141.12 10.10.141.13" b="10.10.141.20 10.10.141.21 10.10.141.22 10.10.141.23" ## functions function commenableA() { for commenable in ${a} do tmsh modify ltm node $commenable session user-enabled done } function commdisableA() { for commenable in ${a} do tmsh modify ltm node $commenable session user-disabled done } function commenableB() { for commenable in ${b} do tmsh modify ltm node $commenable session user-enabled done } function commdisableB() { for commenable in ${b} do tmsh modify ltm node $commenable session user-disabled done } if [ "$1" = "a" ]; then { commenableB commdisableA } else { commenableA commdisableB } fi tmsh save /sys config |
So, what do you think ?