Scripting at start up
hello,
I would like to have a few pointers on scripting, be it shell scripting or etc, whichever appropriate. I would like to do the following automatically when i log on: telnet 192.168.1.1 (my DSL router) admin (username) admin (password) cd /proc/sys/net/ipv4/netfilter echo 2048 > ip_conntrack_max echo 50 > ip_conntrack_generic_timeout echo 5 > ip_conntrack_tcp_timeout_close echo 120 > ip_conntrack_tcp_timeout_close_wait echo 1200 > ip_conntrack_tcp_timeout_established echo 120 > ip_conntrack_tcp_timeout_fin_wait echo 60 > ip_conntrack_tcp_timeout_time_wait echo 10 > ip_conntrack_udp_timeout I have tried putting these into .bash_profile, but it will only proceed up to the first line, and stops when the router asks for username/password. Any help is appreciated, thanks. best regards |
It would be better to have the DSL box do that for you. I'm assuming that DSL supports sysctl, so you can modify /etc/sysctl.conf to do it for you:
Code:
net.ipv4.netfilter.ip_conntrack_max = 2048 Code:
echo 2048 > /proc/sys/net/ipv4/netfilter/ip_conntrack_max |
Nope, my DSL router (it's a D-Link) does not support sysctl.
Maybe I should rephrase my question: how to I use scripting to automate telnet login to my router? |
I see DSL here so often meaning Damn Small Linux that it never occurred to me :) Have you tried something like the following expect script from http://linuxgazette.net/issue50/tag/34.html?
Code:
#!/usr/bin/expect -f |
All times are GMT -5. The time now is 06:15 AM. |