Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | display_usage() { |
Scott Baker | bc4e07c | 2016-07-26 23:44:55 -0700 | [diff] [blame] | 4 | echo -e "\nUsage:\n$0 [xos-listen-port] [service-name]\n" |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 5 | } |
| 6 | |
| 7 | if [ $# -lt 1 ] |
| 8 | then |
| 9 | display_usage |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
Scott Baker | bc4e07c | 2016-07-26 23:44:55 -0700 | [diff] [blame] | 13 | if [ $# -eq 2 ]; then |
| 14 | echo "Sending rebuild request to XOS for service $2" |
| 15 | STATUS=`curl -X POST -F "service=$2" 0.0.0.0:$1/api/utility/onboarding/xos/rebuild/ 2> /dev/null` |
| 16 | if [[ "$STATUS" != "true" ]]; then |
| 17 | echo "Rebuild request failed" |
| 18 | exit -1 |
| 19 | fi |
| 20 | else |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 21 | echo "Sending rebuild request to XOS" |
| 22 | STATUS=`curl -X POST 0.0.0.0:$1/api/utility/onboarding/xos/rebuild/ 2> /dev/null` |
| 23 | if [[ "$STATUS" != "true" ]]; then |
| 24 | echo "Rebuild request failed" |
| 25 | exit -1 |
| 26 | fi |
Scott Baker | bc4e07c | 2016-07-26 23:44:55 -0700 | [diff] [blame] | 27 | fi |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 28 | |
| 29 | echo "Rebuild request accepted" |
| 30 | |