You will need to have SSH enabled on your router.
To enable SSH on Merlin do this:
Under “Advanced Settings” on the left bar click “Administration”.
Under “Miscellaneous” make sure these are set as follows:
Enable SSH - LAN Only (or LAN + WAN if you really need WAN access to SSH)
Allow SSH Port Forwarding - No
SSH service port - 22
Allow SSH access from WAN - No
Allow SSH password login - Yes
Enable SSH Brute Force Protection - No
After you made the changes hit apply.
STEP G:
Please read Final Notes before copying scripts to the router.
You are now ready to create scripts on the router:
Download winSCP
Install WinSCP then start it up.
To make a new connection fill in the fields as follows:
File Protocol – SCP (NOTE: MAKE SURE IT IS SET TO SCP)
Hostname: 192.168.xx.x replace x with values of your routers IP address
Username/Password: Whatever you use to login to the router Port 22
Save login settings and then hit Login.
This will log you into your router.
There will be two folder tree panes. On the right is your router's folder tree.
In the router folder tree, you need to go up to the /root folder, where you will see the /jffs folder under the root.
double click on the /jffs Folder then double click the /jffs/scripts Folder.
(If you have created script using notepad++ on the local Windows machine - Navigate on the left folder tree and find the scripts you created....simply drag'n'drop the script to right folder tree.)
To create scripts directly on the router using the WinSCP editor.... Hit Shift+F4 to open a new script.
Once the file is created/copied, right click > Properties > Click the three 'eXecution' boxes or manually Change Octal to 0777
You may now test the script in the WinSCP terminal
Hit Ctrl-T
A command console window should open. You should now be able to test the script from within /jffs/scripts
Enter
Code:
cd /jffs/scripts
./scriptname
or for debugging
A Reboot will be required to ensure the script is executed during the boot process
e.g. for nat start/firewall-start etc.
NOTE: Ensure you have selected 'Enable JFFS custom scripts and configs' on the Administration->System page.
Close WinSCP