-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
1
  • 3
    What are you trying to achieve? Where did you get this line? It's not a command, but a snipped from systemd service.
    – gronostaj
    Dec 6, 2018 at 12:01

2 Answers 2

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.

3
  • To simplify things a bit more, it would be like curl https://dynupdate.no-ip.com/nic/update --user '$xxxx:$xxx' -d 'hostname=<hostname>.xxxx.ddns.net' Dec 6, 2018 at 12:30
  • @grawity Frankly I don't know curl and such to tell if you're right. The answer is now community wiki, so please improve it freely. Dec 6, 2018 at 12:33
  • Thanks.Yes it's from internet :superuser.com/questions/1380720/… :) Shall I write down all 100 or can I copy paste :) :)
    – ddinc
    Dec 6, 2018 at 13:28
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'
3
  • another layman question :) then:How do I run it from system d ?(I want to run it from system d but as it did not work out I have asked once more)
    – ddinc
    Dec 6, 2018 at 13:45
  • Ask a new question and clarify what you want to do ;) Please review superuser.com/help/how-to-ask
    – mtak
    Dec 6, 2018 at 15:17
  • Solved..........
    – ddinc
    Dec 7, 2018 at 10:01

Not the answer you're looking for? Browse other questions tagged .