You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"ERROR: Failed to start console proxy vm with id $d">>$LOGFILE
98
+
fi
92
99
fi
93
100
done
94
101
95
102
if [ "$length_console"=="0" ];then
96
103
echo -e "No running console proxy vms found \n"
97
104
else
98
-
echo"Done stopping and starting console proxy vms."
99
-
echo"Done stopping and starting console proxy vms.">>$LOGFILE
105
+
echo"Done stopping and starting console proxy vm(s)."
106
+
echo"Done stopping and starting console proxy vm(s).">>$LOGFILE
100
107
fi
101
108
}
102
109
103
110
stop_start_router() {
104
111
router=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "select id from vm_instance where state=\"Running\" and type=\"DomainRouter\""`)
105
112
length_router=(${#router[@]})
106
113
107
-
echo -e "\nStopping and starting running routing vms... "
108
-
echo -e "Stopping and starting running routing vms... ">>$LOGFILE
114
+
echo -e "\nStopping and starting $length_routerrunning routing vm(s)... "
115
+
echo -e "Stopping and starting $length_routerrunning routing vm(s)... ">>$LOGFILE
109
116
110
117
#Spawn reboot router in parallel - run commands in <n> chunks - number of threads is configurable
111
118
@@ -148,7 +155,6 @@ stop_start_router() {
148
155
fi
149
156
150
157
done
151
-
152
158
153
159
if [ "$length_router"=="0" ];then
154
160
echo -e "No running router vms found \n">>$LOGFILE
@@ -157,8 +163,8 @@ stop_start_router() {
157
163
sleep 10
158
164
done
159
165
160
-
echo -e "Done restarting routers. \n"
161
-
echo -e "Done restarting routers. \n">>$LOGFILE
166
+
echo -e "Done restarting router(s). \n"
167
+
echo -e "Done restarting router(s). \n">>$LOGFILE
162
168
163
169
fi
164
170
}
@@ -180,6 +186,7 @@ send_request(){
180
186
181
187
182
188
reboot_router(){
189
+
echo"INFO: Restarting router with id $1">>$LOGFILE
183
190
jobid=`curl -sS "http://$ms:8096/?command=rebootRouter&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
184
191
if [ "$jobid"=="" ];then
185
192
echo"ERROR: Failed to restart domainRouter with id $1">>$LOGFILE
@@ -191,8 +198,10 @@ reboot_router(){
191
198
192
199
if [ "$jobresult"!="1" ];then
193
200
echo"ERROR: Failed to restart domainRouter with id $1">>$LOGFILE
201
+
exit 0
194
202
else
195
203
echo"INFO: Successfully restarted domainRouter with id $1">>$LOGFILE
0 commit comments