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!

wan-start not found?

wayner

Regular Contributor
I have a wan-start script in my /jffs/scripts folder. It looks like this:
Code:
#!/bin/sh
logger -t $(basename $0) $1
ifconfig `nvram get wan_ifnames`:0 192.168.100.2 netmask 255.255.255.0
iptables -t nat -I POSTROUTING -o `nvram get wan_ifnames` -j MASQUERADE
When I try to execute it from a telnet session I get :
Code:
-sh: wan-start: not found
This happens whn I try to execute the script using "wan-start", "./wan-start" or "/jffs/scripts/wan-start". Here is an ls for my jffs/scripts folder.
Code:
drwxr-xr-x    2 wayne    root           0 Apr 19 00:58 .
drwxr-xr-x    5 wayne    root           0 Dec 31  1969 ..
-rwxrwxrwx    1 wayne    root         184 Sep 14 11:29 wan-start
My router is an Asus RT-N66U and my firmware is 374.40 (Merlin Build).

Anyone have any ideas?

p.s The purpose of this script is to allow me to access the web UI of my cable modem at the 192.168.100.1 IP.
 
Try
Code:
sh /jffs/scripts/wan-start

I just checked on my router and works with ./wan-start if cd to /jffs/scripts, then I go to another location and work with both commands /jffs/scripts/wan-start & sh /jffs/scripts/wan-start
 
Last edited:
You're right. There were ^M s at the end of each line. I guess it was the old dos2unix formatting issue.

Is there any way to directly edit jffs scripts from windows? Can I somehow mount the filesystem from my Asus router into windows? I can then use Notepad++ in windows to save as Unix files. Or any other suggestions on the easiest way to move files from Windows to the jffs part of the router?
 
You're right. There were ^M s at the end of each line. I guess it was the old dos2unix formatting issue.

Is there any way to directly edit jffs scripts from windows? Can I somehow mount the filesystem from my Asus router into windows? I can then use Notepad++ in windows to save as Unix files. Or any other suggestions on the easiest way to move files from Windows to the jffs part of the router?
Yes, use winscp to connect and edit with notepad++
 

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