Skip to content

Commit

Permalink
Fix the startup script in docker containers for version 5 (#1208)
Browse files Browse the repository at this point in the history
* Fix the startup script in docker containers for version 5

* Add it to the correct script
  • Loading branch information
helto4real authored Nov 24, 2024
1 parent c222883 commit ef99b9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Docker/rootfs/etc/services.d/netdaemon/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ if [ ! -d "/data" ]; then
fi

if [[ -z "${NetDaemon__ApplicationAssembly}" ]]; then
echo -e "\\033[32mStarting NetDaemon V4 runtime ...\\033[0m" >&2
echo -e "\\033[32mStarting NetDaemon V5 runtime ...\\033[0m" >&2
cd "${daemondir}" || exit 1
exec dotnet NetDaemon.Host.Default.dll
else
if [[ "${NetDaemon__ApplicationAssembly}" == *".csproj" ]]; then
echo -e "\\033[31mcsproj deployments are not supported in v3, use compiled option instead!\\033[0m" >&2
echo -e "\\033[31mcsproj deployments are not supported in v5, use compiled option instead!\\033[0m" >&2
exit 1
fi

Expand All @@ -32,7 +32,7 @@ else
exit 1
fi

echo -e "\\033[32mStarting NetDaemon V4 pre-built runtime using assembly ${NetDaemon__ApplicationAssembly}...\\033[0m" >&2
echo -e "\\033[32mStarting NetDaemon V5 pre-built runtime using assembly ${NetDaemon__ApplicationAssembly}...\\033[0m" >&2
cd "$(dirname "${NetDaemon__ApplicationAssembly}")" || echo -e "\\033[31mCould not change directory to run project\\033[0m" >&2

if [[ "${PWD}" != "$(dirname "${NetDaemon__ApplicationAssembly}")" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions Docker/rootfs/etc/services.d/netdaemon_addon/run
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ if ! bashio::fs.file_exists "/data/options.json"; then
fi

if ! bashio::config.has_value "app_assembly"; then
bashio::log.info "Starting NetDaemon V4 Runtime ..."
bashio::log.info "Starting NetDaemon V5 Runtime ..."
cd "${daemondir}" || bashio::exit.nok "${daemondir} does not exist"
exec dotnet NetDaemon.Host.Default.dll
else
# We have provided an application assembly setting
if [[ "${NetDaemon__ApplicationAssembly}" == *".csproj" ]]; then
bashio::exit.nok "csproj deployments are not supported in v3, use compiled option instead!"
bashio::exit.nok "csproj deployments are not supported in v5, use compiled option instead!"
fi

if [[ "${NetDaemon__ApplicationAssembly}" != *".dll" ]]; then
Expand All @@ -82,7 +82,7 @@ else
bashio::exit.nok "The assembly ${NetDaemon__ApplicationAssembly} cannot be found. Please check the settings."
fi

bashio::log.info "Starting NetDaemon V4 pre-built Runtime using assembly ${NetDaemon__ApplicationAssembly}..."
bashio::log.info "Starting NetDaemon V5 pre-built Runtime using assembly ${NetDaemon__ApplicationAssembly}..."
cd "$(dirname "${NetDaemon__ApplicationAssembly}")" || bashio::exit.nok "Could not change directory to run project"

exec dotnet "$(basename "${NetDaemon__ApplicationAssembly}")"
Expand Down
6 changes: 3 additions & 3 deletions Docker/run-nd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ if [ ! -d "/data" ]; then
fi

if [[ -z "${NetDaemon__ApplicationAssembly}" ]]; then
echo -e "\\033[32mStarting NetDaemon V3 runtime ...\\033[0m" >&2
echo -e "\\033[32mStarting NetDaemon V5 runtime ...\\033[0m" >&2
cd "${daemondir}" || exit 1
exec dotnet NetDaemon.Host.Default.dll
else
if [[ "${NetDaemon__ApplicationAssembly}" == *".csproj" ]]; then
echo -e "\\033[31mcsproj deployments are not supported in v3, use compiled option instead!\\033[0m" >&2
echo -e "\\033[31mcsproj deployments are not supported in v5, use compiled option instead!\\033[0m" >&2
exit 1
fi

Expand All @@ -34,7 +34,7 @@ else
exit 1
fi

echo -e "\\033[32mStarting NetDaemon V3 pre-built runtime using assembly ${NetDaemon__ApplicationAssembly}...\\033[0m" >&2
echo -e "\\033[32mStarting NetDaemon V5 pre-built runtime using assembly ${NetDaemon__ApplicationAssembly}...\\033[0m" >&2
cd "$(dirname "${NetDaemon__ApplicationAssembly}")" || echo -e "\\033[31mCould not change directory to run project\\033[0m" >&2

if [[ "${PWD}" != "$(dirname "${NetDaemon__ApplicationAssembly}")" ]]; then
Expand Down

0 comments on commit ef99b9b

Please sign in to comment.