cmus Posted November 10, 2004 Report Share Posted November 10, 2004 Hi, I am trying to add a launcher to my panel that runs the command "ifup eth1" The problem is that I need to be root in order to run that command. Is there any way to create a launcher that runs as root in the terminal? Mahalo, Craig Quote Link to comment Share on other sites More sharing options...
arctic Posted November 10, 2004 Report Share Posted November 10, 2004 (edited) umm... first of all, which system are you running? mandrake 9.2, 10.0 or 10.1? and which connection type do you use? in case you are running 10.1, there is a plug-icon that does exactly what you want to do. in case you run one of the previous versions, you have two alternatives: 1) activate it as root in case you do not have a flatrate or 2) activate it at startup, so every user will have a neverending network-connection. an alternative is e.g. updating your kde-environment to the latest version from mandrakes urpmi mirrors (will be some 200 mb download). once kde is up to date, you have the little, useful network plug-icon. :) edit: in case you never heard of urpmi and updating with it, just tell us and we will guide you through the procedure. it is very simple. ;) Edited November 10, 2004 by arctic Quote Link to comment Share on other sites More sharing options...
cmus Posted November 10, 2004 Author Report Share Posted November 10, 2004 (edited) Hi Arctic, I am running 10.0 and use the GNOME environment. I use 2 different network connections depending on if I am at home or work. At work I use an ethernet connection (eth0) and at home I use a wireless connection (eth1). I can use either of them with no problem, but I was experiencing long delays at boot because the system would pause looking for IP info and network connections for both of the networks. I disabled both of them at startup which allowed me to boot much faster and then depending on where I am I either run "ifup eth0" or "ifup eth1" to activate my networking. I would simply like to add an icon that I could click on that would carry out this simple command for me so I don't have to open a terminal, change to root, and then type the command. Is this possible? Oh, and I am familiar with urpmi if there is anything I should install. Thanks in advance Craig Edited November 10, 2004 by cmus Quote Link to comment Share on other sites More sharing options...
arctic Posted November 10, 2004 Report Share Posted November 10, 2004 hmm... maybe the "network-control" icon is what you are looking for. it shows you when your system is connected to the net/transfers data and you can right-click "preferences" this will take you directly to the network-activation-panel. but i do not know of a "one-click" version in gnome. sorry. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted November 10, 2004 Report Share Posted November 10, 2004 You can make two scripts to do it but will still be prompted to enter your root password like you do when you launch mcc. All you'll have to do is click on the script icon and enter your root password. Open a console and run: $ touch eth0 eth1 $ gedit eth0 which creates two empty text files in your home directory, eth0 and eth1, that will become your scripts. Take eth0 first. The gedit command will bring up eth0 in gedit. Put the following text in eth0: #!/bin/bash kdesu ifup eth0 Note, the "#" must be at the very beginning of the text file for this to work. Save the file and then run: $ su <enter root password> # chmod a+x eth0 Now open your home directory in nautilus and click on eth0, you should be prompted for your root password; enter it and the command will execute. If it works, you can drag the eth0 script to your desktop or panel and it will still work. You can also change the icon if you want. Rinse and repeat for eth1 changing the command to "kdesu ifup eth1". Now the issue of whether you can get the script to execute w/o entering your root password. I think you can using "sudo" but I'm not that familiar with it and most people would consider giving an ordinary user the ability to bring up or down a network an insecure practice. Sudo allows you to list a series of commands that a designated group of users can run with elevated privileges. Quote Link to comment Share on other sites More sharing options...
cmus Posted November 11, 2004 Author Report Share Posted November 11, 2004 Thanks pmpatrick - works great!!! 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.