mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 05:34:20 +01:00
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
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "Git pull",
|
"name": "Git pull",
|
||||||
"version": "0.2",
|
"version": "0.3",
|
||||||
"slug": "git_pull",
|
"slug": "git_pull",
|
||||||
"description": "Simple git pull to update the local configuration",
|
"description": "Simple git pull to update the local configuration",
|
||||||
"url": "https://home-assistant.io/addons/git_pull/",
|
"url": "https://home-assistant.io/addons/git_pull/",
|
||||||
"startup": "services",
|
"startup": "services",
|
||||||
"boot": "manual",
|
"boot": "manual",
|
||||||
|
"hassio_api": true,
|
||||||
"options": {
|
"options": {
|
||||||
"repositorie": null,
|
"repositorie": null,
|
||||||
"auto_restart": false,
|
"auto_restart": false,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ while true; do
|
|||||||
|
|
||||||
if [ ! -z "$changed_files" ]; then
|
if [ ! -z "$changed_files" ]; then
|
||||||
echo "[Info] files changed, restart Home-Assistant"
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "SSH server",
|
"name": "SSH server",
|
||||||
"version": "2.4",
|
"version": "2.5",
|
||||||
"slug": "ssh",
|
"slug": "ssh",
|
||||||
"description": "Allows connections over SSH",
|
"description": "Allows connections over SSH",
|
||||||
"url": "https://home-assistant.io/addons/ssh/",
|
"url": "https://home-assistant.io/addons/ssh/",
|
||||||
"startup": "services",
|
"startup": "services",
|
||||||
"boot": "auto",
|
"boot": "auto",
|
||||||
|
"hassio_api": true,
|
||||||
"ports": {
|
"ports": {
|
||||||
"22/tcp": 22
|
"22/tcp": 22
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
HASSIO_API="http://172.17.0.2"
|
|
||||||
|
|
||||||
# helppage
|
# helppage
|
||||||
if [ "$1" == "help" ] || [ "$#" -lt 2 ]; then
|
if [ "$1" == "help" ] || [ "$#" -lt 2 ]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -22,7 +20,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function call_api() {
|
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"
|
echo "API error: $api_ret"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user