Need simple script to startup internet service?
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? Thanks. |
Quote:
|
DSL modem, and sometimes I turn off the router as well.
|
If your distro has/uses
/etc/rc.local that's the place to add it. Just append the cmds you'd normally use. It's run by root as the last thing at boot up. |
Quote:
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} |
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? |
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. |
In a shell type the following commands:
cd mkdir bin cd bin touch start_dsl.sh Edit the 'start_dsl.sh' file so that it looks like this: Code:
#!/bin/bash Type the following commands so that the script is executable and runs with root permission: chmod 775 start_dsl.sh sudo chown root start_dsl.sh sudo chmod u+s start_dsl.sh Now create a desktop icon. Type the following in your shell: cd cd Desktop touch start_dsl.desktop Edit the 'start_dsl.desktop' file so that it looks like this (you have to replace <username> with your login username): Code:
[Desktop Entry] Good luck! -- Tony |
All times are GMT -5. The time now is 01:57 AM. |