Browse Source

First version of mass_deploy script

Yann Weber 8 years ago
parent
commit
7c55e4c080
1 changed files with 32 additions and 0 deletions
  1. 32
    0
      progs/mass_deploy.sh

+ 32
- 0
progs/mass_deploy.sh View File

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

Loading…
Cancel
Save