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 →
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:
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"
Maybe a hidden character inside your automation code leading curl
to fail?
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
.
#!/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
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.