free wifi with web html login page - auto login?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
3
down vote

favorite
1












A place where I visit very regularly had open access free wifi with no password on the wifi SSID



However, it's one of the ones where you can connect to the wifi, but when you try to go to a webpage, it first redirects you to a login page, where you have to put in the username and password.
The username and password very rarely change (i.e. it's not changed for at least a year).



Quite frequently my connection drops and I have to go through the logon process again, is there any way to automate this with a script in Linux?



Thanks







share|improve this question
























    up vote
    3
    down vote

    favorite
    1












    A place where I visit very regularly had open access free wifi with no password on the wifi SSID



    However, it's one of the ones where you can connect to the wifi, but when you try to go to a webpage, it first redirects you to a login page, where you have to put in the username and password.
    The username and password very rarely change (i.e. it's not changed for at least a year).



    Quite frequently my connection drops and I have to go through the logon process again, is there any way to automate this with a script in Linux?



    Thanks







    share|improve this question






















      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      A place where I visit very regularly had open access free wifi with no password on the wifi SSID



      However, it's one of the ones where you can connect to the wifi, but when you try to go to a webpage, it first redirects you to a login page, where you have to put in the username and password.
      The username and password very rarely change (i.e. it's not changed for at least a year).



      Quite frequently my connection drops and I have to go through the logon process again, is there any way to automate this with a script in Linux?



      Thanks







      share|improve this question












      A place where I visit very regularly had open access free wifi with no password on the wifi SSID



      However, it's one of the ones where you can connect to the wifi, but when you try to go to a webpage, it first redirects you to a login page, where you have to put in the username and password.
      The username and password very rarely change (i.e. it's not changed for at least a year).



      Quite frequently my connection drops and I have to go through the logon process again, is there any way to automate this with a script in Linux?



      Thanks









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 4 at 9:28









      icarusbop

      213




      213




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          You can perform this with the command POST :





          POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue'


          Then you just have to copy this script in the folder /etc/NetworkManager/dispatcher.d/. When your connect to a network with NetworkManager, it will pass the interface used in $1 and if this is a connect or disconnect in $2 to your script.



          #!/bin/bash
          if [ "$1 $2" = 'wlan0 up' ]
          then
          essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"(.*)".*$/1/')
          case "$essid" in
          'Freewifi')
          POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue' ;;
          'Other')
          POST http://[ADRESS]:[PORT] <<< 'accept_cgu=1' ;;
          esac
          fi


          Be aware to fill all required input in your form (sometimes there is security input and that can be really complicated to automate the connexion in a script).



          That was a long time ago that I perform an script to perform this and I didn't test it.



          Hope this answer help.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031900%2ffree-wifi-with-web-html-login-page-auto-login%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            You can perform this with the command POST :





            POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue'


            Then you just have to copy this script in the folder /etc/NetworkManager/dispatcher.d/. When your connect to a network with NetworkManager, it will pass the interface used in $1 and if this is a connect or disconnect in $2 to your script.



            #!/bin/bash
            if [ "$1 $2" = 'wlan0 up' ]
            then
            essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"(.*)".*$/1/')
            case "$essid" in
            'Freewifi')
            POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue' ;;
            'Other')
            POST http://[ADRESS]:[PORT] <<< 'accept_cgu=1' ;;
            esac
            fi


            Be aware to fill all required input in your form (sometimes there is security input and that can be really complicated to automate the connexion in a script).



            That was a long time ago that I perform an script to perform this and I didn't test it.



            Hope this answer help.






            share|improve this answer


























              up vote
              1
              down vote













              You can perform this with the command POST :





              POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue'


              Then you just have to copy this script in the folder /etc/NetworkManager/dispatcher.d/. When your connect to a network with NetworkManager, it will pass the interface used in $1 and if this is a connect or disconnect in $2 to your script.



              #!/bin/bash
              if [ "$1 $2" = 'wlan0 up' ]
              then
              essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"(.*)".*$/1/')
              case "$essid" in
              'Freewifi')
              POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue' ;;
              'Other')
              POST http://[ADRESS]:[PORT] <<< 'accept_cgu=1' ;;
              esac
              fi


              Be aware to fill all required input in your form (sometimes there is security input and that can be really complicated to automate the connexion in a script).



              That was a long time ago that I perform an script to perform this and I didn't test it.



              Hope this answer help.






              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                You can perform this with the command POST :





                POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue'


                Then you just have to copy this script in the folder /etc/NetworkManager/dispatcher.d/. When your connect to a network with NetworkManager, it will pass the interface used in $1 and if this is a connect or disconnect in $2 to your script.



                #!/bin/bash
                if [ "$1 $2" = 'wlan0 up' ]
                then
                essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"(.*)".*$/1/')
                case "$essid" in
                'Freewifi')
                POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue' ;;
                'Other')
                POST http://[ADRESS]:[PORT] <<< 'accept_cgu=1' ;;
                esac
                fi


                Be aware to fill all required input in your form (sometimes there is security input and that can be really complicated to automate the connexion in a script).



                That was a long time ago that I perform an script to perform this and I didn't test it.



                Hope this answer help.






                share|improve this answer














                You can perform this with the command POST :





                POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue'


                Then you just have to copy this script in the folder /etc/NetworkManager/dispatcher.d/. When your connect to a network with NetworkManager, it will pass the interface used in $1 and if this is a connect or disconnect in $2 to your script.



                #!/bin/bash
                if [ "$1 $2" = 'wlan0 up' ]
                then
                essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"(.*)".*$/1/')
                case "$essid" in
                'Freewifi')
                POST http://[ADRESS]:[PORT]/ <<< 'auth_user=ID&auth_pass=PASSWORD&accept=Continue' ;;
                'Other')
                POST http://[ADRESS]:[PORT] <<< 'accept_cgu=1' ;;
                esac
                fi


                Be aware to fill all required input in your form (sometimes there is security input and that can be really complicated to automate the connexion in a script).



                That was a long time ago that I perform an script to perform this and I didn't test it.



                Hope this answer help.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 4 at 10:18









                pa4080

                12k52255




                12k52255










                answered May 4 at 9:52









                Eraseth

                1299




                1299






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031900%2ffree-wifi-with-web-html-login-page-auto-login%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Running the scala interactive shell from the command line

                    Unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst)

                    What makes Checkinstall packages not suitable for distribution?