Dustpuppy Posted October 19, 2004 Report Share Posted October 19, 2004 (edited) I'd like to be able to re-start my network automatically in 10OE at KDE startup (there's something wrong with my network card and it won't work otherwise!). I've tried putting the (executable) file "network.sh" #!/bin/bash su service network stop service network start into ~/.kde/Autostart and nothing happens. I also just want it to run without having to enter the root password. Is this possible? TIA! Edited October 19, 2004 by Dustpuppy Quote Link to comment Share on other sites More sharing options...
Dustpuppy Posted October 22, 2004 Author Report Share Posted October 22, 2004 <bump> Any ideas? Quote Link to comment Share on other sites More sharing options...
bvc Posted October 22, 2004 Report Share Posted October 22, 2004 this was discussed a few times recently, and I think there was an answer but I don't remember what it was. Have a look in /etc/profile.d ?? Quote Link to comment Share on other sites More sharing options...
aru Posted October 23, 2004 Report Share Posted October 23, 2004 (edited) I'd like to be able to re-start my network automatically in 10OE at KDE startup (there's something wrong with my network card and it won't work otherwise!). I've tried putting the (executable) file "network.sh"#!/bin/bash su service network stop service network start into ~/.kde/Autostart and nothing happens. I also just want it to run without having to enter the root password. Is this possible? TIA! <{POST_SNAPBACK}> su -c "command 1 && command 2" see "man su". 'su' executes a new shell and once it finishes it returns to its parent shell, so in your script su runs, and ends returning to its caller, hence 'service network ...' calls are from the parent shell not from 'su' btw, don't do it through su (your script can provide root's password automatically each time, for example using 'expect' see its man page, but is trully unsafe) but through permissions and group ids (man chmod) if you trust your users ;) hth Edited October 23, 2004 by aru Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.