-1

I get:

root@dm820:~# ExecStart=/usr/bin/curl'https://dynupdate.no-ip.com/nic/update' --header "Authorization: Basic <$xxxx:$xxx>" -d 'hostname=<hostname>.xxxx.ddns.net'
-sh: --header: command not found
mtak
  • 17,262
ddinc
  • 1

2 Answers2

1

what do I make wrong?

ExecStart=/usr/bin/curl'https://dynupdate.no-ip.com/nic/update' --header "Authorization: Basic <$xxxx:$xxx>" -d 'hostname=<hostname>.xxxx.ddns.net'
  1. You're defining ExecStart variable and trying to run --header. The syntax is like

    foo=bar some_command option1 option2
    
  2. You're using the full path /usr/bin/curl. Unless you know it's right and you need the full path, you should rely on your $PATH and use just curl.

  3. You have no space after curl.

  4. You're trying to run curl as root.

  5. You're running a command (like random code from the Internet?) you apparently don't understand as root.

To fix:

  • Write 100 times "I won't run commands I don't understand as root". :)
  • Drop ExecStart=, it's a part of systemd syntax.
  • Use just curl.
  • Put a space after curl.

It will be like

curl 'https://dynupdate.no-ip.com/nic/update' --header "Authorization: Basic <$xxxx:$xxx>" -d 'hostname=<hostname>.xxxx.ddns.net'

where <$xxxx:$xxx> and <hostname> are still placeholders you need to change to something valid.

0

If you want to run this from the command line and not from systemd, you have to run it like this:

curl 'https://dynupdate.no-ip.com/nic/update' --header "Authorization: Basic <$xxxx:$xxx>" -d 'hostname=<hostname>.xxxx.ddns.net'
mtak
  • 17,262