diff --git a/adb/rootfs/etc/cont-init.d/20-config.sh b/adb/rootfs/etc/cont-init.d/20-config.sh deleted file mode 100644 index f20ad2f..0000000 --- a/adb/rootfs/etc/cont-init.d/20-config.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/with-contenv bashio -# ============================================================================== -# Community Hass.io Add-ons: Android Debug Bridge -# Handles configuration paths for ADB -# ============================================================================== -declare path - -# Default storage keys path storage location -path="/data" - -# If the user specified a custom keys path, use that. -if bashio::config.has_value 'keys_path'; then - path="$(bashio::config 'keys_path')" -fi - -ln -sf "${path}" /root/.android diff --git a/adb/rootfs/etc/cont-init.d/10-requirements.sh b/adb/rootfs/etc/cont-init.d/adb.sh similarity index 80% rename from adb/rootfs/etc/cont-init.d/10-requirements.sh rename to adb/rootfs/etc/cont-init.d/adb.sh index 039cb62..da16f41 100644 --- a/adb/rootfs/etc/cont-init.d/10-requirements.sh +++ b/adb/rootfs/etc/cont-init.d/adb.sh @@ -1,8 +1,10 @@ #!/usr/bin/with-contenv bashio # ============================================================================== # Community Hass.io Add-ons: Android Debug Bridge -# This files check if all user configuration requirements are met +# Configures ADB # ============================================================================== +declare path + if bashio::config.has_value 'keys_path' \ && ! bashio::fs.directory_exists "$(bashio::config 'keys_path')"; then @@ -26,3 +28,13 @@ if ! bashio::config.has_value 'devices'; then bashio::log.warning 'The add-on might not work as expected.' bashio::log.warning fi + +# Default storage keys path storage location +path="/data" + +# If the user specified a custom keys path, use that. +if bashio::config.has_value 'keys_path'; then + path="$(bashio::config 'keys_path')" +fi + +ln -sf "${path}" /root/.android