treo650,
I'm willing to help you but, owing to potential liability issues, I'd prefer not to tinker with your router.
You don't need to use vi to create the files. If you've formatted a USB key with an ext2 partition then I assume you have access to Linux. There are several text-editors for Linux that will allow you to easily create files.
FWIW, I used an old version of
Puppy Linux. It boots from a CD and includes GParted, a well-known disk partitioning/formatting tool. It also includes Leafpad which is similar to Windows' Notepad.
General installation instructions:
- Add the line mentioned above to the Tomato router's Init script.
- Reboot router.
- Boot PC with Puppy Linux on CDROM.
- Insert USB key.
- Click "Drives" icon. USB key is /dev/sda1 (or at least it was on my system).
- Run "Network > GParted" and format /dev/sda1 as a single partition with the "ext2" format and a label of "optware".
- Run "Drives" and unmount /dev/sda1.
- Remove the USB key and plug it into the router.
- Using Tomato's GUI, check USB and NAS > USB Support > Attached Drives and confirm the USB key is mounted as /opt.
- Proceed to install Optware (let me know if you need more help for this item).
- Use ipkg to install stunnel.
- Configure "stunnel.conf" file as per the instructions in a previous post.
You are not obliged to create .autorun and .autostop files. You can simply put the commands in Tomato's GUI ("Run after mounting" and "Run before unmounting"). If you do wish to use the "auto" files, you have three choices to create them:
- Log into the router and use vi.
- Plug the USB key back into the PC running Puppy Linux and use the Leafpad editor.
- Log into the router and use echo to append lines to the files like so:
echo "#!/bin/sh" > /opt/00-mount.autorun
echo "/opt/etc/init.d/S68stunnel" >> /opt/00-mount.autorun
echo "#!/bin/sh" > /opt/00-umount.autostop
echo "killall stunnel 2>/dev/null" >> /opt/00-umount.autostop
Finally, change the permissions of the two files so that they are executable by root. While logged in to the router, enter the following commands:
cd /opt
chmod 0755 00-mount.autorun
chmod 0755 00-umount.autostop
Reboot the router. The USB key will be automatically mounted and stunnel will start. Log into the router, run "ps", and confirm stunnel is displayed in the list (should be seven instances of stunnel). A quick test is to run "telnet localhost 5000" and you should get a welcome message from Gmail's ESMTP server. Type "quit" to close the telnet connection to Gmail.