What's new
  • 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!

[Solved] Automated setup script not working

thelonelycoder

Part of the Furniture
I'm trying to create an automated setup script. As a guide I'm going off of the entware-setup.sh script located in /usr/sbin/.
It all works very well so far but there's one thing that makes no sense to me.
If I name the file myscript-setup.sh it will throw all sorts of errors when I run it and will abort the setup.
Some errors look like this:
Code:
: not foundetup.sh: line 2:
: not foundetup.sh: line 9:
myscript-setup.sh: cd: line 11: can't cd to /tmp
Here's the curious thing: When renaming the file to entware-setup.sh the script runs just fine.
Do I need to reference some includes to make it run with a different name than entware-setup.sh ?
 
Very strange.

Those are the same messages you would get if you had DOS EOL characters in the file. Presumably you don't. Are you using a non-standard shell? Bash perhaps?
 
Working fine now, thanks Colin.
Overlooking the obvious. I have "Show EOL" enabled in Notepad++ and still missed that. I guess my eyes got so used to ignore those characters that I didn't see them. I wish I could blend the LF out and only show CRLF to make them stand out more.
 
BTW, dos2unix is now included in Asuswrt-Merlin, making it easier to convert foreign scripts.
 
BTW, dos2unix is now included in Asuswrt-Merlin, making it easier to convert foreign scripts.
Thanks, that'll help as well to sanitize input.
 
@RMerlin is dos2unix only included in the 380.57 alpha or do I have a blind eye in the 378.56_2 release and cannot find it?
 
@RMerlin is dos2unix only included in the 380.57 alpha or do I have a blind eye in the 378.56_2 release and cannot find it?

It should be in 378.56_2, unless for some reason that commit didn't make the cut when I build the release firmware.
 
It should be in 378.56_2, unless for some reason that commit didn't make the cut when I build the release firmware.
Not on the RT-AC66U build.
I have my RT-AC87U on the 380 alpha and dos2unix is on it.
 

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!
Back
Top