| Author |
Message |
|
|
Post subject: script that restarts the network, how do i do it?
Posted: Oct 12, 2007 - 11:54 AM
|
|

Joined: Dec 02, 2006
Posts: 154
Location: Copenhagen, Denmark
Status: Offline
|
|
Never did a script before, so here goes: wifes laptop now and then looses the connection to the router (wireless), this is fixed by restarting it. Opening a console, getting root permissions and restarting the network interface is more complicated than my wife is willing to learn about her operating system, so i need to write a small script that does the job after prompting her for the root password, like
Code:
#!/bin/bash
/etc/initd/networking restart
-But how do i make the script prompt for root password before executing? |
_________________ linuxuser 377268
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 12, 2007 - 12:40 PM
|
|

Joined: Feb 24, 2007
Posts: 679
Location: Berlin, Germany
Status: Offline
|
|
| Just create a starter in your panel or on the desktop, that runs
Code:
kdesu /etc/init.d/networking restart
fetch a nice little icon for it and you are done.
cheers Micha |
_________________ http://sidux.com/PNphpBB2-viewtopic-t-2403.html
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 12, 2007 - 01:01 PM
|
|

Joined: Dec 06, 2006
Posts: 219
Location: Italy
Status: Offline
|
|
even better thanks to slh:
Code:
su-me "/etc/init.d/networking restart"
|
_________________ sidux-it
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 12, 2007 - 07:43 PM
|
|

Joined: Dec 02, 2006
Posts: 154
Location: Copenhagen, Denmark
Status: Offline
|
|
|
|
|
 |
|
|
Post subject:
Posted: Apr 15, 2008 - 12:06 AM
|
|
Joined: Mar 28, 2008
Posts: 51
Status: Offline
|
|
| I needed this. I have sidux installed in another room and invariably I forget to plug in the network cable into my hub. I wait and eventually it starts, but this will save me some time. Thank you. |
|
|
| |
|
|
|
 |
|
|
|
|