Announcement

Collapse
No announcement yet.

Internet connection with pon / poff

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Internet connection with pon / poff

    I'm using the command ' sudo pon dsl-provider and sudo poff dsl-provider ' to connect/disconnect to the internet.

    Connection is done on startup automatically and everything works fine , but I would like to have the option to connect/disconnect with one click (just like with the network-manager that doesn't work well with my wired modem for some reason...)

    Can I make a button on the desktop for that ?
    Something that on click will run the command sudo pon/poff dsl-provider ?

    #2
    Yeah, easy enough. I made an icon to open and close my DVD-ROM drive tray and put it in the panel. You could use something like that or create a service menu entry that would show on a right-click on the desktop.

    Probably, the Desktop file with the panel icon would be the most usable. I'm not a my linux box at the moment, but some bored coder will happen along in a few. If not, I'll help you with it later on when I have a chance.

    Please Read Me

    Comment


      #3
      I used to have a system tray icon that did just that, but I cant find the file....maybe I deleted it. It basically checked to see what state the internet connection was in and then turned it on or off. Ill keep searching to see if I can find it.

      Comment


        #4
        Does anybody know if there are any disadvantages to using the pon/poff commands for internet connection versus using the network manager ?
        And why there are two ways to connect to the internet on the system ?

        Comment


          #5
          Originally posted by ronshor View Post
          Does anybody know if there are any disadvantages to using the pon/poff commands for internet connection versus using the network manager ?
          And why there are two ways to connect to the internet on the system ?
          Since NM is just a GUI for network connections, there's no disadvantage per se that I can think of. As to your second question, there's likely way more than two ways to connect. There's more than two types of devices that can be used, more than two programs to connect with, more than two distros, etc.

          I would ask; "Do you want to be artificially restricted to a single way to do anything just because, or do you prefer choices?" Linux, above most other things, is all about user choice and control. You get to tinker about until you find the way you like to do something, and then you get to do it that way! Joyous!

          Please Read Me

          Comment


            #6
            Okay, now I understand.
            Thanks for your answer !

            Can you help me with the Icon I asked in my first post here ?

            Comment


              #7
              I'm not at my linux box at the moment, I'll post back later tonight.

              Please Read Me

              Comment


                #8
                That would be great !
                I really need this icon. It would make everything much more simple.

                Comment


                  #9
                  create a text file named pon.sh and type into it:
                  Code:
                  #! /bin/bash
                  pon dsl-provider
                  I don't know if you need sudo for that. If so, just add sudo to the beginning.
                  Then right-click on the file and set (under permissions) the file as executable. Then drag it to your desktop.
                  Do the same for your poff command.
                  Once on your desktop, you can change the icon to something pretty.
                  I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

                  Comment


                    #10
                    I don't like icons on my actual desktop and prefer them in the panel. That's why I went the panel icon route.

                    ronshor, I recommend three steps:

                    #1: Create a proper script file that will detect the status of your dsl-connection and then connect or dis-connect it as needed. I don't use a modem directly, but I'm sure someone on here knows what command will easily detect that. Sorry, using pon/poff is not in my wheelhouse.

                    #2: Add the pon/poff commands to the sudoers list of commands that do not need a password. Also, it's more elegant to create a new file rather than editing sudoers as it's easier to maintain through updates. Create a file under /etc/sudoers.d with the contents:
                    Code:
                    user host = (root) NOPASSWD: /usr/bin/pon
                    user host = (root) NOPASSWD: /usr/bin/poff
                    using the visudo program like this:

                    sudo visudo -f /etc/sudoers.d/dsltoggle

                    This should result in being able to do "sudo pon dsl-provider" and "sudo poff dsl-provider" without the sudo and thus without a password. No doubt some security paranoids will chime in on why not to do this, but it makes a lot of sense in this case.

                    #3: Create your desktop file. I created a file called "Eject.desktop", put it in ~/.local/share/applications and then added it to my kmenu using kmenuedit. Then you need only drag it from the kmenu to your panel or your desktop if you prefer.

                    Here's mine as an example:
                    Code:
                    [Desktop Entry]
                    Comment[en_US]=
                    Comment=
                    Exec=ksystraycmd /usr/bin/eject -T /dev/sr0 &
                    GenericName[en_US]=
                    GenericName=
                    Icon=drive-optical
                    MimeType=application/x-plasma;
                    Name[en_US]=Disc Eject
                    Name=Disc Eject
                    Path=
                    StartupNotify=false
                    Terminal=false
                    TerminalOptions=
                    Type=Application
                    X-DBUS-ServiceName=
                    X-DBUS-StartupType=
                    X-KDE-SubstituteUID=false
                    X-KDE-Username=
                    X-SuSE-translate=true
                    Change the name and icon to your preferred choices. Then point the "Exec=" to your script file.

                    Please Read Me

                    Comment


                      #11
                      Originally posted by ronshor View Post
                      are any disadvantages to using the pon/poff commands
                      The only disadvantage I can think of is that including a strategically-placed "r" in those commands won't get you anything interesting. Sigh.

                      Comment

                      Working...
                      X