blob: 0033c9a7bcd4b3576f91cf54c6d9f945791c7ad7 [file] [log] [blame]
Scott Baker4b37d1a2016-07-01 13:41:52 -07001#! /bin/bash
2
3display_usage() {
Scott Bakerbc4e07c2016-07-26 23:44:55 -07004 echo -e "\nUsage:\n$0 [xos-listen-port] [service-name]\n"
Scott Baker4b37d1a2016-07-01 13:41:52 -07005}
6
7if [ $# -lt 1 ]
8then
9 display_usage
10 exit 1
11fi
12
Scott Bakerbc4e07c2016-07-26 23:44:55 -070013if [ $# -eq 2 ]; then
14echo "Sending rebuild request to XOS for service $2"
15STATUS=`curl -X POST -F "service=$2" 0.0.0.0:$1/api/utility/onboarding/xos/rebuild/ 2> /dev/null`
16if [[ "$STATUS" != "true" ]]; then
17 echo "Rebuild request failed"
18 exit -1
19fi
20else
Scott Baker4b37d1a2016-07-01 13:41:52 -070021echo "Sending rebuild request to XOS"
22STATUS=`curl -X POST 0.0.0.0:$1/api/utility/onboarding/xos/rebuild/ 2> /dev/null`
23if [[ "$STATUS" != "true" ]]; then
24 echo "Rebuild request failed"
25 exit -1
26fi
Scott Bakerbc4e07c2016-07-26 23:44:55 -070027fi
Scott Baker4b37d1a2016-07-01 13:41:52 -070028
29echo "Rebuild request accepted"
30