mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Update hostapps.sh
This commit is contained in:
parent
17d3ca4234
commit
3d465a019e
@ -1,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
SUPERVISOR=""
|
||||||
|
SUPERVISOR_VERSION=""
|
||||||
|
SUPERVISOR_ARGS=""
|
||||||
|
CLI=""
|
||||||
|
CLI_VERSION=""
|
||||||
|
CLI_ARGS=""
|
||||||
DATA_IMG="/export/data.img"
|
DATA_IMG="/export/data.img"
|
||||||
|
|
||||||
# Make image
|
# Make image
|
||||||
@ -20,7 +26,7 @@ DOCKER_PID=$!
|
|||||||
starttime="$(date +%s)"
|
starttime="$(date +%s)"
|
||||||
endtime="$(date +%s)"
|
endtime="$(date +%s)"
|
||||||
until docker info >/dev/null 2>&1; do
|
until docker info >/dev/null 2>&1; do
|
||||||
if [ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]; then
|
if [ $((endtime - starttime)) -le 30 ]; then
|
||||||
sleep 1
|
sleep 1
|
||||||
endtime=$(date +%s)
|
endtime=$(date +%s)
|
||||||
else
|
else
|
||||||
@ -28,3 +34,23 @@ until docker info >/dev/null 2>&1; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Install supervisor
|
||||||
|
docker pull ${SUPERVISOR}:${SUPERVISOR_VERSION}
|
||||||
|
docker tag ${SUPERVISOR}:${SUPERVISOR_VERSION} ${SUPERVISOR}:latest
|
||||||
|
|
||||||
|
# Install cli
|
||||||
|
docker pull ${CLI}:${CLI_VERSION}
|
||||||
|
docker tag ${CLI}:${CLI_VERSION} ${CLI}:latest
|
||||||
|
|
||||||
|
# Write config
|
||||||
|
echo << EOF
|
||||||
|
{
|
||||||
|
"supervisor": "${SUPERVISOR}",
|
||||||
|
"supervisor_args": "${SUPERVISOR_ARGS}",
|
||||||
|
"cli": "${CLI}",
|
||||||
|
"cli_args": "${CLI_ARGS}"
|
||||||
|
}
|
||||||
|
EOF > /mnt/hassio.json
|
||||||
|
|
||||||
|
# Finish
|
||||||
|
kill -TERM $DOCKER_PID && wait $DOCKER_PID && umount /mnt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user