From 742d47936175b67812599f8aef435a3e8cd9b0cb Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 29 Mar 2023 20:37:37 +0200 Subject: [PATCH] Convert scripts to unix before execution https://github.com/alexbelgium/hassio-addons/issues/775 --- .templates/01-custom_script.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.templates/01-custom_script.sh b/.templates/01-custom_script.sh index 9b77fc363..7cfacb836 100755 --- a/.templates/01-custom_script.sh +++ b/.templates/01-custom_script.sh @@ -11,6 +11,11 @@ if [ -f /config/"${slug}".sh ]; then mv -f /config/"${slug}".sh /config/addons_autoscripts/"${slug}".sh fi +# Convert scripts to linux +if [ -f /usr/bin/dos2unix ]; then + dos2unix /config/addons_autoscripts/"${slug}".sh +fi + # Execute scripts if [ -f /config/addons_autoscripts/"${slug}".sh ]; then bashio::log.info "... script found, executing"