Skip to content
Snippets Groups Projects
Commit 8ac8d6bc authored by hestiahacker's avatar hestiahacker
Browse files

Re-added OpenHAB setup with better error handling this time

parent 903fca81
Branches
No related tags found
No related merge requests found
...@@ -249,72 +249,82 @@ while [ $server_is_up -eq 0 ]; do ...@@ -249,72 +249,82 @@ while [ $server_is_up -eq 0 ]; do
done done
echo "Server is now up and running." echo "Server is now up and running."
## Standard setup # Standard setup
#count=0 echo "Running setup wizard..."
#failed=0 count=0
#echo "Running setup wizard..." failed=1
#curl --fail -s 'http://localhost:8080/start/index?type=standard' || echo "Failed start/index?type=standard" while [ $failed -eq 1 ]; do
#curl --fail -s -H 'Content-Type: application/json' http://localhost:8080/rest/services/org.eclipse.smarthome.i18n/config || echo "Failed i18n/config" echo "Attempting to trigger the setup process for the last $count minutes"
## When the index page includes Paper UI, it's safe to continue count=$((count+1))
#curl --fail -s http://localhost:8080/start/index | grep "Paper UI" || failed=1 sleep 60
#while [ $failed -eq 1 ]; do failed=0
# echo "Waiting for server to finish setup. It's been $count minutes" curl --fail -s 'http://localhost:8080/start/index?type=standard' || failed=1
# count=$((count+1)) done
# sleep 60 count=0
# failed=0 failed=1
# curl --fail -s http://localhost:8080/start/index | grep "Paper UI" || failed=1 while [ $failed -eq 1 ]; do
#done echo "Checking to see if setup is complete. Elapsed time: $count minutes"
count=$((count+1))
# Installing exec, http, GPIO and MQTT bindings as well as Map and Regex transformations sleep 60
#for binding in binding-exec binding-http1 binding-mqtt binding-gpio1 transformation-map transformation-regex; do failed=0
# # POST to request the binding get installed curl --fail -s -H 'Content-Type: application/json' http://localhost:8080/rest/services/org.eclipse.smarthome.i18n/config || failed=1
# curl --fail -s -H 'Content-Type: application/json' --data-ascii "{\"id\":\"$binding\"}" "http://localhost:8080/rest/extensions/$binding/install" done
#done # When the index page includes Paper UI, it's safe to continue
## Wait for each of them to show up in the list of installed bindings count=0
#for binding in exec http mqtt gpio; do failed=1
# count=0 while [ $failed -eq 1 ]; do
# failed=0 echo "Waiting for server to finish setup. It's been $count minutes"
# curl --fail -s "http://localhost:8080/rest/bindings" | grep -q $binding || failed=1 count=$((count+1))
# while [ $failed -eq 1 ]; do sleep 60
# echo "Waiting for server to finish installing $binding bindings. It's been $count minutes" failed=0
# count=$((count+1)) curl --fail -s http://localhost:8080/start/index | grep "Paper UI" || failed=1
# sleep 60 done
# failed=0
# curl --fail -s "http://localhost:8080/rest/bindings" | grep -q $binding || failed=1 echo "Installing exec, http, GPIO & MQTT bindings; Map & Regex transformations"
# done for binding in binding-exec binding-http1 binding-mqtt binding-gpio1 transformation-map transformation-regex; do
#done # POST to request the binding get installed
# curl --fail -s -H 'Content-Type: application/json' --data-ascii "{\"id\":\"$binding\"}" "http://localhost:8080/rest/extensions/$binding/install"
## Install OpenHAB Cloud Connector done
#count=0 # Wait for each of them to show up in the list of installed bindings
#failed=0 for binding in exec http mqtt gpio; do
#echo "Installing OpenHAB Cloud Connector..." count=0
#curl --fail -s -H 'Content-Type: application/json' --data-ascii '{"id":"misc-openhabcloud"}' 'http://localhost:8080/rest/extensions/misc-openhabcloud/install' || failed=1 failed=0
#while [ $failed -eq 1 ]; do curl --fail -s "http://localhost:8080/rest/bindings" | grep -q $binding || failed=1
# echo "Waiting for server to finish installing OpenHAB Cloud Connector. It's been $count minutes" while [ $failed -eq 1 ]; do
# count=$((count+1)) echo "Waiting for server to finish installing $binding bindings. It's been $count minutes"
# sleep 60 count=$((count+1))
# failed=0 sleep 60
# curl --fail -s 'http://localhost:8080/rest/extensions/misc-openhabcloud' | grep -q '"installed":true' || failed=1 failed=0
#done curl --fail -s "http://localhost:8080/rest/bindings" | grep -q $binding || failed=1
# done
## Installing Map and Regex transformations done
#for transformation in transformation-map transformation-regex; do # Wait for each of them to show up in the list of installed transformation
# # POST to request the transformation get installed for transformation in transformation-map transformation-regex; do
# curl --fail -s -H 'Content-Type: application/json' --data-ascii "{\"id\":\"$transformation\"}" "http://localhost:8080/rest/extensions/$transformation/install" count=0
#done failed=0
## Wait for each of them to show up in the list of installed transformation curl --fail -s "http://localhost:8080/rest/extensions/$transformation" | grep -q '"installed":true' || failed=1
#for transformation in transformation-map transformation-regex; do while [ $failed -eq 1 ]; do
# count=0 echo "Waiting for server to finish installing $transformation transformation. It's been $count minutes"
# failed=0 count=$((count+1))
# curl --fail -s "http://localhost:8080/rest/extensions/$transformation" | grep -q '"installed":true' || failed=1 sleep 60
# while [ $failed -eq 1 ]; do failed=0
# echo "Waiting for server to finish installing $transformation transformation. It's been $count minutes" curl --fail -s "http://localhost:8080/rest/extensions/$transformation" | grep -q '"installed":true' || failed=1
# count=$((count+1)) done
# sleep 60 done
# failed=0
# curl --fail -s "http://localhost:8080/rest/extensions/$transformation" | grep -q '"installed":true' || failed=1
# done # Install OpenHAB Cloud Connector
#done count=0
failed=0
echo "Installing OpenHAB Cloud Connector..."
curl --fail -s -H 'Content-Type: application/json' --data-ascii '{"id":"misc-openhabcloud"}' 'http://localhost:8080/rest/extensions/misc-openhabcloud/install' || failed=1
while [ $failed -eq 1 ]; do
echo "Waiting for server to finish installing OpenHAB Cloud Connector. It's been $count minutes"
count=$((count+1))
sleep 60
failed=0
curl --fail -s 'http://localhost:8080/rest/extensions/misc-openhabcloud' | grep -q '"installed":true' || failed=1
done
# The user interfaces installed by default are fine # The user interfaces installed by default are fine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment