From d24aa7d3e4adc87a942756c0a41535962870c4ab Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 9 Aug 2017 09:32:38 +0200 Subject: [PATCH] Migrate ssh/git_pull to new hassio_api feature of 0.51 (#167) * Update config.json * Use new API link * Update config.json * Update run.sh * Update config.json --- git_pull/config.json | 3 ++- git_pull/run.sh | 2 +- ssh/config.json | 3 ++- ssh/hassio | 4 +--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/git_pull/config.json b/git_pull/config.json index c1fcb43..6bbfe56 100644 --- a/git_pull/config.json +++ b/git_pull/config.json @@ -1,11 +1,12 @@ { "name": "Git pull", - "version": "0.2", + "version": "0.3", "slug": "git_pull", "description": "Simple git pull to update the local configuration", "url": "https://home-assistant.io/addons/git_pull/", "startup": "services", "boot": "manual", + "hassio_api": true, "options": { "repositorie": null, "auto_restart": false, diff --git a/git_pull/run.sh b/git_pull/run.sh index 12b8480..1ba896e 100644 --- a/git_pull/run.sh +++ b/git_pull/run.sh @@ -31,7 +31,7 @@ while true; do if [ ! -z "$changed_files" ]; then echo "[Info] files changed, restart Home-Assistant" - curl -s http://172.17.0.2/homeassistant/restart 2&> /dev/null || true + curl -s http://hassio/homeassistant/restart 2&> /dev/null || true fi fi diff --git a/ssh/config.json b/ssh/config.json index 2b79365..1a68843 100644 --- a/ssh/config.json +++ b/ssh/config.json @@ -1,11 +1,12 @@ { "name": "SSH server", - "version": "2.4", + "version": "2.5", "slug": "ssh", "description": "Allows connections over SSH", "url": "https://home-assistant.io/addons/ssh/", "startup": "services", "boot": "auto", + "hassio_api": true, "ports": { "22/tcp": 22 }, diff --git a/ssh/hassio b/ssh/hassio index feb0b12..1b86616 100644 --- a/ssh/hassio +++ b/ssh/hassio @@ -1,8 +1,6 @@ #!/bin/bash set -e -HASSIO_API="http://172.17.0.2" - # helppage if [ "$1" == "help" ] || [ "$#" -lt 2 ]; then cat << EOF @@ -22,7 +20,7 @@ EOF fi function call_api() { - if ! api_ret="$(curl -s -X $1 "$HASSIO_API/$2/$3")"; then + if ! api_ret="$(curl -s -X $1 "http://hassio/$2/$3")"; then echo "API error: $api_ret" exit 1 fi