]> git.stg.codes - stg.git/commitdiff
Added scripts to generate network aliases and delete it
authorMaxim Mamontov <faust@gts.dp.ua>
Thu, 5 May 2011 14:59:03 +0000 (17:59 +0300)
committerMaxim Mamontov <faust@gts.dp.ua>
Thu, 5 May 2011 14:59:03 +0000 (17:59 +0300)
projects/sgauthstress/mkifs.sh [new file with mode: 0755]
projects/sgauthstress/rmifs.sh [new file with mode: 0755]

diff --git a/projects/sgauthstress/mkifs.sh b/projects/sgauthstress/mkifs.sh
new file mode 100755 (executable)
index 0000000..b73ca71
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+users=`cat users.1000`
+hi=0
+lo=0
+for user in $users
+do
+    cp -R /var/stargazer/users/test /var/stargazer/users/$user
+    if (( $lo > 254 ))
+    then
+        lo=0
+        let hi++
+    fi
+    let lo++
+    ip="10.22.$hi.$lo"
+    ip addr add $ip dev eth0
+done
diff --git a/projects/sgauthstress/rmifs.sh b/projects/sgauthstress/rmifs.sh
new file mode 100755 (executable)
index 0000000..6469f0d
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+users=`cat users.1000`
+hi=0
+lo=0
+for user in $users
+do
+    cp -R /var/stargazer/users/test /var/stargazer/users/$user
+    if (( $lo > 254 ))
+    then
+        lo=0
+        let hi++
+    fi
+    let lo++
+    ip="10.22.$hi.$lo/32"
+    ip addr del $ip dev eth0
+done