|
@@ -0,0 +1,47 @@
|
|
|
+print_usage(){
|
|
|
+ echo
|
|
|
+ echo "script usage: $(basename $0) [-n node] [-a] [-1] [-2] [-h] " >&2
|
|
|
+ echo "type: '$(basename $0) -h' for help"
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+print_help(){
|
|
|
+ echo
|
|
|
+ echo "$(basename $0): a useless script"
|
|
|
+ echo
|
|
|
+ echo "options:"
|
|
|
+ echo " -n Print the hostname of the specified node"
|
|
|
+ echo " -a Print the hostname of all nodes"
|
|
|
+ echo " -1 Print the hostname of all nodes in LCM1"
|
|
|
+ echo " -2 Print the hostname of all nodes in LCM2"
|
|
|
+ echo " -h Print this help message"
|
|
|
+ command_parsed=1
|
|
|
+
|
|
|
+
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+call_node(){
|
|
|
+ printf "$1 says: "
|
|
|
+ ssh $1 'hostname' #come si fa a non mostrare il messaggio?
|
|
|
+
|
|
|
+
|
|
|
+ command_parsed=1
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+call_1(){
|
|
|
+ for i in {0..12}
|
|
|
+ do
|
|
|
+ call_node ${LCM1[i]}
|
|
|
+ done
|
|
|
+ command_parsed=1
|
|
|
+}
|
|
|
+
|
|
|
+call_2(){
|
|
|
+ for i in {0..14}
|
|
|
+ do
|
|
|
+ call_node ${LCM2[i]}
|
|
|
+ done
|
|
|
+ command_parsed=1
|
|
|
+}
|