ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware, KDE.
Sometimes I turn off my modem when I reboot and I forget to turn it back on during bootup, SO I have to do
cd /etc/rc.d
then
./rc.inet1
to startup the internet service.
Is there a simple script I can create and run on my desktop or from command line I can do to startup the internet instead of having to login as root and change to the directory then issue ./rc.inet1 evertime?
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761
Rep:
Quote:
DSL modem, and sometimes I turn off the router as well.
Your probably getting a dynamic assigned IP address, dhcpcd is run from /etc/rc.d/rc.inet1 file.
Reading the man dhcpcd, the -t timeout is defaulted to 60 seconds, which means it will try for 60 seconds to get an address. Setting -t timeout to 0 seconds will keep trying forever to get an address. So when you turn your modem and router back on, dhcpcd should pick up an address. Edit /etc/rc.d/rc.inet1, look for
Code:
/sbin/dhcpcd -d -t ${DHCP_TIMEOUT[$i]:-60}
and change -60 to -0, then restart. See if that helps you.
I would like to be able to either click on an icon on the desktop or type in a command in the console to start up the internet service.
Is there a way to do that?
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761
Rep:
Setting dhcpcd timeout to 0 not working? Did you try it?
Networking requires root permission, so clicking an icon or running a script will require root's permission. So if your set to use mouse clicks or running a script, then you might as well stick with what your did before posting the question.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.