Jump to content

panel launcher command as root [SOLVED]


cmus
 Share

Recommended Posts

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 by arctic
Link to comment
Share on other sites

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 by cmus
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...