mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 18:43:39 +02:00
Update 99-run.sh
This commit is contained in:
@@ -88,16 +88,31 @@ fi
|
|||||||
bashio::log.info "Starting..."
|
bashio::log.info "Starting..."
|
||||||
|
|
||||||
cd /
|
cd /
|
||||||
if [ -f /usr/src/app/bin/cloudcmd.mjs ]; then
|
declare CLOUDCMD_BIN=""
|
||||||
CLOUDCMD_BIN=/usr/src/app/bin/cloudcmd.mjs
|
declare -a cloudcmd_candidates=(
|
||||||
elif [ -f /usr/src/app/bin/cloudcmd.js ]; then
|
/usr/src/app/bin/cloudcmd.mjs
|
||||||
CLOUDCMD_BIN=/usr/src/app/bin/cloudcmd.js
|
/usr/src/app/bin/cloudcmd.js
|
||||||
elif command -v cloudcmd >/dev/null 2>&1; then
|
/usr/src/cloudcmd/bin/cloudcmd.mjs
|
||||||
CLOUDCMD_BIN=cloudcmd
|
/usr/src/cloudcmd/bin/cloudcmd.js
|
||||||
else
|
)
|
||||||
bashio::log.error "Cloud Commander binary not found in /usr/src/app/bin or PATH."
|
|
||||||
|
for candidate in "${cloudcmd_candidates[@]}"; do
|
||||||
|
if [ -f "$candidate" ]; then
|
||||||
|
CLOUDCMD_BIN="$candidate"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$CLOUDCMD_BIN" ] && command -v cloudcmd >/dev/null 2>&1; then
|
||||||
|
CLOUDCMD_BIN=$(command -v cloudcmd)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$CLOUDCMD_BIN" ]; then
|
||||||
|
bashio::log.error "Cloud Commander binary not found in expected locations or PATH."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
bashio::log.info "Using Cloud Commander binary: ${CLOUDCMD_BIN}"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
"$CLOUDCMD_BIN" $DROPBOX_TOKEN $CUSTOMOPTIONS &
|
"$CLOUDCMD_BIN" $DROPBOX_TOKEN $CUSTOMOPTIONS &
|
||||||
bashio::net.wait_for 8000 localhost 900 || true
|
bashio::net.wait_for 8000 localhost 900 || true
|
||||||
|
|||||||
Reference in New Issue
Block a user