What's new

How to send http request in user script?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

When you use curl from an ssh prompt, it will GET the file and write it to the current directory (unless you use the -o option, or redirect it (>)). But when you use the same script w/ the bootup process, where is the file being written to?! You aren't specific. You just assume it's writable. Seems to me you should be specific as to /path/filename (e.g., /tmp/somefile, /jffs/somefile).
Ok, may be your are right, I will check it tomorrow and reply you.
Thanks.
 
It works, thanks, great.
For some reason that commands do not written in documentation.
Probably because these arent really scripting commands per se.

Most people working in Unix/Linux know by now to use a proper editor and even windows has gotten better about this so "dos2unix" is rarely a common issue. Once run once, there is no need to run it again (do your editing in Linux or use a Linux compatible editor on windows)

Similarly the "chmod" command set file permissions. Once set, they won't change on their own. This is a security/environmental issue, not scripting per se.
 
Similarly the "chmod" command set file permissions. Once set, they won't change on their own. This is a security/environmental issue, not scripting per se.
The issue in this case was that he hadn't set the file permissions correctly. This is explained in the documentation but he must have missed it. This was what I wanted him to check in post #4 but he didn't do that. Instead he ran the script through the bash interpreter which doesn't require the file permissions to be set.
 
@ColinTaylor I have one more question, may be you know why another script doesn't work for me, i do the same action like with service-event script but for some reason it doesn't work.
In this documentation told that there are some another scripts for different event, but i dont understand why they doesn't work for me.
 
If you provide the details we can have a look.
Ok, for example, i have created the file wan-event put it to /jffs/scripts execute commands dos2unix /jffs/scripts/wan-event and chmod 755 /jffs/scripts/wan-event then do restart wan, but that script doesn't execute.
 
OK, how exactly are you restarting the WAN? Do you see messages in the syslog indicating that the WAN has restarted?
 
Last edited:
OK, how exactly are you restarting the WAN? Do you see messages in the syslog indicating that the WAN has restarted?
This router connected to lan prot on another router "main" and i have blocked "asus" router on "main" router, after that i got in log that wan port of "asus" router lost the link.

1657206619898.png
 
Try physically unplugging the WAN cable, waiting 30 seconds and then plugging it back in.

Also, upload the complete syslog to pastebin.com as only seeing a tiny section of it is not particularly helpful.

What is it that you're trying to achieve here? What does your script do?
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top