PeterPawn / YourFritz

dynamic package management for AVM routers
GNU General Public License v2.0
225 stars 63 forks source link

juic not running on macosx #5

Closed oriziena closed 6 years ago

oriziena commented 6 years ago

hi,

frist thing was: ./juis_check juis_check: Eine benötigte ausführbare Datei fehlt: realpath.

this can be fixed via: sudo echo '/usr/bin/readlink "$@"' > /usr/local/bin/realpath sudo chmod +x /usr/local/bin/realpath

second open one: ./juis_check juis_check: Unter '/proc' muss ein 'procfs' verfügbar sein für die korrekte Funktion dieses Skripts.

greetings andreas

PeterPawn commented 6 years ago

OK, MacOS X is a PITA, as usual.

I've created a new branch "juis_macosx" - please try the "juis_check" version from there again. Remove your "realpath" surrogate first, please - I'd like to know, if it works "out of the box".

Meanwhile I've updated the master branch with a new version, which uses only 'nc' as non-POSIX command anymore. With these changes, the current version should run on MacOS X, too.

I'll close this issue here ... feel free to re-open, if the problem persists or any other MacOS X related problem occurs.

oriziena commented 6 years ago

after pulling i get following error

./juis_check 10.0.0.12 Public=0 stat: illegal option -- c usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...] juis_check: Es wurden Daten mit einem unerwarteten Format empfangen vom Server.

PeterPawn commented 6 years ago

OK, next try ... now I've replaced 'stat' (where GNU and BSD use different options and what's not a POSIX utility) with 'wc -c' to get the size of request body. Changes were applied directly to 'master' branch.

oriziena commented 6 years ago

still not running.. greetings

./juis_check -d 10.0.0.1                                       :(
debug: -------------------------------------------------------
debug: Lesen der Parameter von '10.0.0.1:80/juis_boxinfo.xml': .
debug: Antwort vom Gerät:
debug: -------------------------------------------------------
       HTTP/1.1 200 OK
       Cache-Control: max-age=120
       Connection: close
       Content-Type: text/xml;charset=utf-8
       Date: Wed, 24 Jan 2018 12:24:20 GMT
       ETag: "89835F5A32E2F0795"
       Expires: Wed, 24 Jan 2018 12:26:20 GMT
       Last-Modified: Sun, 21 Jan 2018 01:29:33 GMT
       Mime-Version: 1.0

       <e:BoxInfo xmlns:e="http://juis.avm.de/updateinfo" xmlns:q="http://juis.avm.de/request">
       <q:Name>FRITZ!Box 7590</q:Name>
       <q:HW>226</q:HW>
       <q:Major>154</q:Major>
       <q:Minor>6</q:Minor>
       <q:Patch>98</q:Patch>
       <q:Buildnumber>49782</q:Buildnumber>
       <q:Buildtype>1000</q:Buildtype>
       <q:Serial>ccce1eb2bf32</q:Serial>
       <q:OEM>avm</q:OEM>
       <q:Lang>de</q:Lang>
       <q:Country>049</q:Country>
       <q:Annex>B</q:Annex>
       <q:Flag>crashreport</q:Flag>
       <q:Flag>avm_acs</q:Flag>
       <q:Flag>myfritz_letsencrypt</q:Flag>
       <q:UpdateConfig>3</q:UpdateConfig>
       <q:Provider>tonline</q:Provider></e:BoxInfo>

debug: Zusammengesetzte Versionsnummer für die Prüfung: '154.06.98-49782'
debug: -------------------------------------------------------
debug: Werte der Variablen:
debug: -------------------------------------------------------
debug: Serial="ccce1eb2bf32"
debug: Name="FRITZ!Box 7590"
debug: HW="226"
debug: OEM="avm"
debug: Lang="de"
debug: Annex="B"
debug: Country="049"
debug: Major="154"
debug: Minor="6"
debug: Patch="98"
debug: Buildnumber="49782"
debug: Flag="crashreport avm_acs myfritz_letsencrypt"
debug: Public="1"
debug: type="1001"
debug: hostname="226.jws.avm.de"
debug: nonce="MTM6MjQ6MjMwMS8yNC8xOA=="
debug: -------------------------------------------------------
debug: Gesendete Abfrage:
debug: -------------------------------------------------------
       POST /Jason/UpdateInfoService HTTP/1.1
       Host: 226.jws.avm.de:80
       Content-Length: 1275
       Content-Type: text/xml; charset="utf-8"
       Connection: close

       <soap:Envelope xmlns:soap="h    p://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="h    p://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="h    p://www.w3.org/2001/XMLSchema-ins  ance" xmlns:xsd="h    p://www.w3.org/2001/XMLSchema" xmlns:e="h    p://juis.avm.de/upda  einfo" xmlns:q="h    p://juis.avm.de/reques  ">
         <soap:Header/>
         <soap:Body>
           <e:BoxFirmwareUpda  eCheck>
             <e:Reques  Header>
               <q:Nonce>MTM6MjQ6MjMwMS8yNC8xOA==</q:Nonce>
               <q:UserAgen  >Box</q:UserAgen  >
               <q:ManualReques  >  rue</q:ManualReques  >
             </e:Reques  Header>
             <e:BoxInfo>
               <q:Name>FRITZ!Box 7590</q:Name>
               <q:HW>226</q:HW>
               <q:Major>154</q:Major>
               <q:Minor>6</q:Minor>
               <q:Pa  ch>98</q:Pa  ch>
               <q:Buildnumber>49782</q:Buildnumber>
               <q:Build  ype>1001</q:Build  ype>
               <q:Serial>ccce1eb2bf32</q:Serial>
               <q:OEM>avm</q:OEM>
               <q:Lang>de</q:Lang>
               <q:Coun  ry>049</q:Coun  ry>
               <q:Annex>B</q:Annex>
               <q:Flag>crashrepor  </q:Flag><q:Flag>avm_acs</q:Flag><q:Flag>myfri  z_le  sencryp  </q:Flag>
               <q:Upda  eConfig>1</q:Upda  eConfig>
               <q:Provider>oma_lan</q:Provider>
             </e:BoxInfo>
           </e:BoxFirmwareUpda  eCheck>
         </soap:Body>
       </soap:Envelope>
debug: -------------------------------------------------------
debug: Lesen der Antwort von '226.jws.avm.de:80': .
debug: Empfangene Antwort:
debug: -------------------------------------------------------
       HTTP/1.1 500 Internal Server Error
       Server: nginx
       Content-Type: text/xml;charset=UTF-8
       Content-Length: 1408
       Connection: close
       Date: Wed, 24 Jan 2018 12:24:23 GMT

       <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><soap:Body ID="Body"><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"h    p://schemas.xmlsoap.org/soap/envelope/", the namespace on the "Envelope" element, is not a valid SOAP version.</faultstring><detail></detail></soap:Fault><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod><Reference URI="#Body"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod><DigestValue>xejJoCdGCf7kG1sI2LpEacmHIN6s6rTTno9m+CsbfqU=</DigestValue></Reference></SignedInfo><SignatureValue>eOHDmzPqr/CYvq3nJJ0UkH3zN9aJro83/OBbX8yNaS9N+B/XwJffdMnufAgxYHjXKcOvgjYjUVyn67/1ecvQwwHssOD8qaFQTKt0IEzZnhoNqrcIlLUmLlEbIek1DOsJgistzLnMJbvP8stdAY3Yv3WUofoWRU0zHHDLDbg+23DYjRiKeCTrgMA04WkSLxsU5pgdANVrF4/7XQDHBo4rQAH7RgdHUM+r5b9a7tcNqjx2rWon5LvqXxo8Fe/jjDsUmSKGPI8rVz1JQSVeLRdN7M85Sw86qqYPonVo6a8uLuBdpVaIpg29s29fe+HoMNftObXUnlY0l7dumKOjwR8CrA==</SignatureValue></Signature></soap:Body></soap:Envelope>

./juis_check 10.0.0.1 Public=0 juis_check: Es wurden Daten mit einem unerwarteten Format empfangen vom Server.

PeterPawn commented 6 years ago

The failing 'sed' call wasn't really needed anymore, because indentation was already done with spaces. (But MacOS X is very strict and correct here, other systems accept the '\t' outside of square brackets, even if the standard describes it different.)

Next version has been checked-in - looks like the end of the script is near the location of the last error and there're only little chances to run into more problems.

oriziena commented 6 years ago

with latest commit everything seems to be fine!

thanks a lot 👍

PeterPawn commented 6 years ago

Thanks for your tests and feedback.