# AUTO\_SETUP\_CUSTOM\_SCRIPT\_EXEC going wrong only on startup

**URL:** <https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555>\
**Category:** General Discussion\
**Created:** [1 June 2025 20:16 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555 "2025-06-01T20:16:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jok3r89](https://dietpi.com/forum/user_avatar/dietpi.com/jok3r89/32/7946_2.png) [@Jok3r89](https://dietpi.com/forum/u/Jok3r89)\
**Post date:** [1 June 2025 20:16 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/1 "2025-06-01T20:16:34Z")

</div>

Hello,  
I’m currently automating my dietpi build, but I’m having trouble with the dietpi.txt file and the script. I’m hosting my shell on gitblit. On first boot, I get the message “url using bad/illegal format or missing url,” but later, when I run the exact curl, it works.

What am I doing wrong?

Thanks in adv for you help

is working →

```auto
curl -sSfL http://192.168.188.201:8080/raw/ehive/Automation_Custom_Script.git/7ef2ab29a0678934c5621086bd8551c7f1d6c259/Automation_Custom_Script.sh -o /boot/Automation_Custom_Script.sh

```

Log:

```auto
e[0me[0m
e[Je[90m[e[0m e[90m]e[0m e[90mDietPi-Software |e[0m curl -sSfL http://192.168.188.201:8080/raw/ehive/Automation_Custom_Script.git/7ef2ab29a0678934c5621086bd8551c7f1d6c259/Automation_Custom_Script.sh -o /boot/Automation_Custom_Script.she[0me[2Ge[1;33m. e[0me[Ce[2Ge[0;33m.e[1;33m. e[0me[Ccurl: (3) URL using bad/illegal format or missing URL
e[0m
e[Je[90m[e[0me[31mFAILEDe[90m]e[0m e[90mDietPi-Software |e[0m curl -sSfL http://192.168.188.201:8080/raw/ehive/Automation_Custom_Script.git/7ef2ab29a0678934c5621086bd8551c7f1d6c259/Automation_Custom_Script.sh -o /boot/Automation_Custom_Script.sh
e[0me[0m
e[J"

```

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [1 June 2025 20:40 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/2 "2025-06-01T20:40:32Z")

</div>

Maybe a hidden character inside your automation code leading `curl` to fail?

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [1 June 2025 20:46 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/3 "2025-06-01T20:46:30Z")

</div>

> [@Jok3r89](#):
>
> `curl: (3) URL using bad/illegal format or missing URL`

Though from the log, the URL actually looks good. It is also quoted within our script to avoid any unintended special character handling.

Not sure if this is some formatting issue, but it looks like there is one space too much between curl flags and URL: `-sSfL http`. Can you show the the `dietpi.txt` entry? There must not be any space after `AUTO_SETUP_CUSTOM_SCRIPT_EXEC=`. Actually a bit strict and we could strip white spaces at start and end of config values 🤔.

---

<div class="post-metadata">

**Author:** ![Jok3r89](https://dietpi.com/forum/user_avatar/dietpi.com/jok3r89/32/7946_2.png) [@Jok3r89](https://dietpi.com/forum/u/Jok3r89)\
**Post date:** [1 June 2025 21:00 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/4 "2025-06-01T21:00:46Z")

</div>

> [@Joulinar](#):
>
> Maybe a hidden character inside your automation code leading `curl` to fail?

```auto
#!/bin/bash
# Logfile-Verzeichniss erstellen
LOG_DIR=/var/log/evcc
mkdir -p $LOG_DIR

# Überprüfen, ob der Benutzer root-Rechte hat
if [$(id -u) -ne 0]; then
  echo "Bitte als root-Benutzer ausführen."
  echo " Bitte als root-Benutzer ausführen: $?" >> $LOG_DIR/evcc_install.log
fi

# EVCC-Repository hinzufügen
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.evcc.io/public/evcc/stable/setup.deb.sh' | sudo -E bash

sudo apt update
sudo apt install -y evcc

# EVCC installieren
if ! sudo apt install -y evcc; then
  echo "Fehler bei der Installation von EVCC: $(date)" >> $LOG_DIR/evcc_install.log
  echo "Fehlermeldung: $?" >> $LOG_DIR/evcc_install.log
fi

# EVCC-Dienst starten und aktivieren
if ! sudo systemctl start evcc; then
  echo "Fehler beim Starten des EVCC-Dienstes: $(date)" >> $LOG_DIR/evcc_service.log
  echo "Fehlermeldung: $?" >> $LOG_DIR/evcc_service.log
fi
if ! sudo systemctl enable evcc; then
  echo "Fehler beim Aktivieren des EVCC-Dienstes: $(date)" >> $LOG_DIR/evcc_service.log
  echo "Fsehlermeldung: $?" >> $LOG_DIR/evcc_service.log
fi

```

no think not, it’s std

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [1 June 2025 21:07 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/5 "2025-06-01T21:07:00Z")

</div>

The script is not the issue, but the URL that points to the script was not accepted by `curl`, hence my suggestion to check the `dietpi.txt` entry for white spaces.

---

<div class="post-metadata">

**Author:** ![Jok3r89](https://dietpi.com/forum/user_avatar/dietpi.com/jok3r89/32/7946_2.png) [@Jok3r89](https://dietpi.com/forum/u/Jok3r89)\
**Post date:** [5 June 2025 05:34 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/6 "2025-06-05T05:34:51Z")

</div>

thanks to @MichaIng . The first character was a white spaces. The issue is solved

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [3 September 2025 05:34 UTC](https://dietpi.com/forum/t/auto-setup-custom-script-exec-going-wrong-only-on-startup/23555/7 "2025-09-03T05:34:58Z")

</div>

Closed on 3 September 2025 05:34 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
