vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Need help running from USB mounted as "/opt" not "/jffs" #40

Closed esassaman closed 7 years ago

esassaman commented 7 years ago

I have very little experience with linux shells so I'm stumbling in the dark a bit here. I've got optware installed so my USB stick's mount point is called "/opt". I downloaded 1.8.0 fresh and wiped the old bwmon files completely. I've copied the bwmon files into /opt/bwmon. I did a quick hack to the scripts thinking if I just replace all the hardcoded "/jffs" magic strings to "/opt" that just might make it work. Worth a shot, right? And since I don't have lighttpd installed at all, the scripts are actually attempting to access /tmp/www instead of /jffs/www so I don't think my edits make a bit of difference. I get the same failures with the originals.

If I run "/opt/bwmon/install.sh" from the command shell text box in ddwrt on the admin page I get the following error: sh: eval: line 1: /opt/bwmon/install.sh: not found

Which seems really weird since for sure it is in that directory. Absolutely positive.

I've also been trying to run the shell scripts via the terminal window in winSCP. After setting execute permissions on all the files, I start the terminal window, and run "sh install.sh" but I get these errors: /opt/bwmon$ sh install.sh install.sh: line 2: : not found install.sh: cd: line 5: can't cd to . install.sh: line 6: : not found install.sh: line 16: : not found

doing some amateur debugging the SCRIPT_DIR variable is getting set to ".", not "/opt/bwmon" which I believe is what it is expecting.

After looking at what install.sh does I realized since I've already set execute perms manually I can just try running start.sh. Results from the ddwrt command window running /opt/bwmon/start.sh: /opt/bwmon/start.sh: line 32: /opt/bwmon/lighttpd-running.sh: not found bandwidth monitor started use /opt/bwmon/bwmon-stop.sh to stop /opt/bwmon/start.sh: line 41: /opt/bwmon/bwmon-autobackup.sh: not found /opt/bwmon/start.sh: line 38: /opt/bwmon/bwmon-running.sh: not found

From the winscp terminal: /opt/bwmon$ sh start.sh start.sh: cd: line 3: can't cd to . start.sh: line 4: : not found start.sh: line 45: syntax error: end of file unexpected (expecting "then")

In the past I've been able to install and run bwmon successfully from the ddwrt terminal window. I just run /opt/bwmon/start.sh and it used to fire right up. So I have gotten this working just fine in the past.

Any hints?

esassaman commented 7 years ago

Found the problem. Converted the scripts to correct EOL characters and everything works. Sheesh.