No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mass_deploy.sh 632B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. if [ -f '/usr/share/dict/words' ]
  3. then
  4. random_name=$(sed -nE 's/^([A-Za-z0-9]+)$/\1/p' /usr/share/dict/words |shuf|head -n1)
  5. else
  6. random_name=$RANDOM
  7. fi
  8. ninstance=$1
  9. instance=${ninstance:=50}
  10. echo -n "You are going to create $ninstance lodel2 instances. Are you sure ? Y/n "
  11. read rep
  12. if [ "$rep" = "Y" ]
  13. then
  14. echo "GO ! (you have 3 secs to cancel)"
  15. sleep 3
  16. else
  17. echo "You didn't answer 'Y' (yeah, case matter =P), exiting"
  18. exit
  19. fi
  20. echo "Creating instances"
  21. for i in $(seq $ninstance)
  22. do
  23. iname="${random_name}_$(printf "%05d" $i)"
  24. slim -n $iname -c
  25. slim -n $iname -s --interface web
  26. slim -n $iname -m
  27. done