Skip to content

Instantly share code, notes, and snippets.

@selbstgemacht
Created November 17, 2017 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save selbstgemacht/a329743b5743091c4779a07923629b27 to your computer and use it in GitHub Desktop.
Save selbstgemacht/a329743b5743091c4779a07923629b27 to your computer and use it in GitHub Desktop.
bash script to automatically upload lets encrypt ssl certificates to hosteurope KIS
#!/bin/sh
#HostEurope-Zugangsdaten
KUNDENNR=''
PASSWORD=''
#HostEurope-Vertrag ID und Verzeichnis ID (steht als v_ip im Link wenn man den SSL Upload im KIS aufruft
VERTRAGS_ID=''
VERZEICHNIS_ID=''
#lokales Unterverzeichnis im /etc/letsencrypt/live/ Ordner (-> Domainname) in dem die Zertifikate gespeichert sind
ETC_DOMAINVZ=''
curl -k --url "https://kis.hosteurope.de/?kdnummer=$KUNDENNR&passwd=$PASSWORD" \
-F "v_id=$VERZEICHNIS_ID" \
-F "menu=6" \
-F "mode=sslupload" \
-F "wp_id=$VERTRAGS_ID" \
-F "submode=sslfileupload" \
-F "keypass=" \
-F "certfile=@/etc/letsencrypt/live/$ETC_DOMAINVZ/fullchain.pem" \
-F "keyfile=@/etc/letsencrypt/live/$ETC_DOMAINVZ/privkey.pem" \
-F "cafile=" \
-F "sumbit=Absenden" \
--url "https://kis.hosteurope.de/administration/webhosting/admin.php" \
--url "https://kis.hosteurope.de/?logout=1" \ -c /dev/null >/dev/null 2>1
@psysmile
Copy link

Hi and thank you for providing this script.
Unfortunatelly I did not get it running and I only put in the variables which I need.

this is my error message and I hope you can help:

`sh upload_tokis.sh
upload_tokis.sh: line 3: $'\r': command not found
upload_tokis.sh: line 4: $'\r': command not found
upload_tokis.sh: line 5: $'\r': command not found
upload_tokis.sh: line 7: $'\r': command not found
upload_tokis.sh: line 8: $'\r': command not found
upload_tokis.sh: line 9: $'\r': command not found
upload_tokis.sh: line 11: $'\r': command not found
upload_tokis.sh: line 12: $'\r': command not found

<title>KIS Login</title>
        <div class="main_wrapper toast hide">
            <div class="error"></div>
            <div class="info"></div>
            <div class="resetPass"></div>
        </div>

        <div class="main_wrapper content">

            <div class="content_line header">
                <a href="https://www.hosteurope.de/">
                    <img src="/gfx/faceLift/he_login_logo.png"/>
                </a>
                <h1>Kunden-Informations-System (KIS)</h1>
            </div>
            <div class="clear"></div>

            <div class="content_line login">

                <!-- <div class="login_error"></div> -->

                <form action="/?kdnummer=&passwd=" id="f" method="post" name="f" style="width:100%">
                    <input type="hidden" name="is_fl" value="1"/>
                    <input type="hidden" name="lang" value="de"/>
                    <input type="hidden" name="login_type" value=""/>
                    <!-- <div class="login_extra_params"></div> -->

                    <div class="line">
                        <p class="label">Kundennummer/Nutzername:</p>
                        <input class="fo username_input" maxlength="255" name="kdnummer" onfocus="setFocus = false;" type="text" value=""/>
                    </div>

                    <div class="line hide" id="reset_password">
                        <p class="label">##METHOD##</p>
                        <input class="fo" type="radio" name="method" value="email" id="email" checked="checked"/>
                        <label for="email">##METHOD3##</label>
                        <input class="fo" type="radio" name="method" value="sms" id="sms"/>
                        <label for="sms">##METHOD2##</label>&nbsp;
                    </div>

                    <div class="line">
                        <p class="label" id="label_placeholder">Passwort:</p>

                        <input autocomplete="off" class="fo second_input" id="user_password" maxlength="32" name="passwd" onfocus="setFocus = false;" type="password"/>
                        <span title="Passwort versteckt" id="show_password"></span>
                    </div>

                    <div class="line">
                        <input onclick="hidePassword()" class="fo" type="submit" value="Abschicken"/>
                    </div>
                </form>

                <div class="reset_password">
                    <a href="https://kis.hosteurope.de/kundenkonto/smslogin.php">Passwort vergessen?</a>
                    <a href="#"></a>
                </div>
                <div class="reset_password">
                    <a class="loginwarning" href="https://kis.hosteurope.de/kundenkonto/forgotusername.php">Nutzername vergessen?</a><br /><br />
                    <a href="#"></a>
                </div>

            </div>
            <div class="clear"></div>

            <div class="content_line info">
                Bitte beachten Sie, dass Aktivitäten im KIS für 12 Wochen protokolliert werden. Diese können Sie im Kundenkonto einsehen.
                <br/>
                Um das KIS in vollem Umfang nutzen zu können, müssen Sie in Ihrem Browser Cookies und Javascript erlauben.
            </div>
            <div class="clear"></div>

            <div class="content_line other">
                <h1>Weitere Logins:</h1>
                <div class="clear"></div>

                <a href="https://webmailer.hosteurope.de/" target="_blank" class="external_link">Webmailer-Login</a>
                <a href="http://portal.office.com/" target="_blank" class="external_link">Office 365</a>

            </div>
            <div class="clear"></div>

            <div class="content_line other" style="text-align:center">
              <div class="extra_links">
                <a href="/?logout=1&amp;login=mail">Login zur E-Mail-Konto-Administration</a>
              </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="main_wrapper footer">
            <a href="https://www.hosteurope.de/">Zurück zur Startseite</a>
        </div>

    </div>
<script type="text/javascript" src="/javascript/jquery/jquery-1.10.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { // Focus On Input Fields setFocus(); // Show/Hide Toast container checkToastContainer(); checkIfResetPassword(); }); function checkToastContainer(){ var display = false; cnt = $(".main_wrapper.toast .error").text(); if(cnt){ display = true; } cnt = $(".main_wrapper.toast .info").text(); if(cnt){ display = true; } cnt = $(".main_wrapper.toast .resetPass").text(); if(cnt){ display = true; } if(display){ $(".main_wrapper.toast").removeClass("hide"); } } function checkIfResetPassword(){ // Is reset password page? if(!$("#reset_password").hasClass("hide") || $("#reset_password").hasClass("username")){ // Set email as default method $('input:radio[name=method]').val(['email']); $("#show_password").remove(); }else{ $("#reset_password").remove(); } } // show password if ($("#show_password").length > 0) { $("#show_password").on("click", function () { var inputType = $("#user_password").attr("type"); if (inputType != "password") { inputType = "password"; $("#show_password").removeClass("kis-password-visible"); var title = "Passwort versteckt"; } else { inputType = "text"; $("#show_password").addClass("kis-password-visible"); var title = "Passwort sichtbar"; } $("#show_password").attr("title", title); $("#user_password").attr("type", inputType); }); } // hide password function hidePassword() { var inputType = $("#user_password").attr("type"); if (inputType != "password") { inputType = "password"; $("#show_password").removeClass("kis-password-visible"); var title = "Passwort versteckt"; $("#show_password").attr("title", title); $("#user_password").attr("type", inputType); } } function setFocus(){ var enabled = true; if(enabled){ if($(".username_input").val() == ""){ $(".username_input").focus(); }else{ $(".second_input").focus(); } } } $('input[name=method]').on('change', function() { val = $('input[name=method]:checked').val(); if(val == "email"){ $("#label_placeholder").text("Passwort"); }else{ $("#label_placeholder").text("##THIRDPARAMNAME##"); } }); </script> curl: (3) Illegal characters found in URL upload_tokis.sh: line 14: -F: command not found upload_tokis.sh: line 15: -F: command not found upload_tokis.sh: line 16: -F: command not found upload_tokis.sh: line 17: -F: command not found upload_tokis.sh: line 18: -F: command not found upload_tokis.sh: line 19: -F: command not found upload_tokis.sh: line 20: -F: command not found upload_tokis.sh: line 21: -F: command not found upload_tokis.sh: line 22: -F: command not found upload_tokis.sh: line 23: -F: command not found upload_tokis.sh: line 24: --url: command not found `

@psysmile
Copy link

ok, das Problem habe ich gelöst, allerdings kommt gar keine Ausgabe mehr und die Daten werden nicht hochgeladen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment