Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Linux script zum resintallieren

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Linux script zum resintallieren

    This topic has been deleted. Only users with topic management privileges can see it.
    • Bluefox
      Bluefox last edited by

      Ich suche einen Linux Experte, der so einen Bash Skript schreiben konnte:

      • 1. stop iobroker: iobroker stop

      • 2. liste alle adapters in node_modules und speichere es irgendwo - ls -1 | grep iobroker.

      • 3. dann alles in node_modules löschen: cd node_modules; rm * -R

      • 4. Für jeden in der gespeicherten Liste aufrufen: npm install %f –production;cd node_modules/%f/; npm install --production

      Ich habe Probleme bei 2 und 4

      Das sollte sein Skript sein um ioBroker frisch zu installieren.

      P.S. ein Windows Skript währe auch nicht schlecht. Ich weiß, dass es möglich ist. 😉
      18138_qivicon_log.rtf

      1 Reply Last reply Reply Quote 0
      • S
        steinwedel last edited by

        Problem zwei könntest Du durch folgendes perl-script lösen:

        #!/usr/bin/perl -w
        open(STREAM, "./iobroker list adapters|");
        
        while (<stream>) {
          ($firstEntry) = split;
          $firstEntry=substr($firstEntry,15);
          print $firstEntry . "\n"; 
        }
        
        close(STREAM);</stream> 
        

        Aufrufen des Skripts gibt auf der Console die Adapter aus. Das Ergebnis kann man in eine Datei umleiten. Schöner wäre es natürlich, diese Ausgabe in das iobroker Skript zu integrieren.

        Gruß Gerhard

        1 Reply Last reply Reply Quote 0
        • Bluefox
          Bluefox last edited by

          Eigentlich sollte so was möglich sein:

          iobroker stop
          ls -1 node_modules/ | grep iobroker. > list.txt
          cd node_modules; rm * -R
          while read in; do npm install $in --production; cd node_modules/$in/; npm install --production; cd ../..; done < list.txt
          
          
          1 Reply Last reply Reply Quote 0
          • Bluefox
            Bluefox last edited by

            @Bluefox:

            Eigentlich sollte so was möglich sein:

            iobroker stop
            ls -1 node_modules/ | grep iobroker. > list.txt
            cd node_modules; rm * -R
            while read in; do npm install $in --production; cd node_modules/$in/; npm install --production; cd ../..; done < list.txt
            chmod 777 * - R
            
            ```` `  
            

            Aber danke für die Idee mit der Datei 🙂

            1 Reply Last reply Reply Quote 0
            • Jey Cee
              Jey Cee Developer last edited by

              Hi Bluefox,

              ich hab da mal ein script gebaut, muss aber noch getestet werden.

              Das script muss mit sudo ausgeführt werden.

              EDIT: Hab es getestet, es läuft bis "npm install –production", danach kommen nur noch fehler.

              #!/bin/bash
              
              IFS=/r>\n'
              
              /opt/iobroker/iobroker stop
              
              Module=`find /opt/iobroker/node_modules -maxdepth 1 -name "iobroker*" -type d`
              
              rm /opt/iobroker/node_modules/* -f -R
              
              for modul in $Module; do
                      modul="${modul#/*/*/*/}"
                       npm install  $modul --production
                       cd /opt/iobroker/node_modules/$modul/
                       npm install --production
              done
              
              unset Module
              unset modul
              unset IFS
              
              
              1 Reply Last reply Reply Quote 0
              • Bluefox
                Bluefox last edited by

                Danke an alle. Das solle Lauffähiges Skript sein:

                iobroker stop
                ls -1 ./node_modules | grep iobroker. > list.txt
                cd node_modules; 
                rm * -R
                cd ..
                while read in; do npm install $in --production; cd node_modules/$in/; npm install --production; cd ../..; done < list.txt
                chmod 777 * -R
                rm list.txt
                iobroker upload all
                
                

                Werde dann rein nehmen.

                1 Reply Last reply Reply Quote 0
                • Bluefox
                  Bluefox last edited by

                  Jetzt brauche ich so was für Windows batch. 😉

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  742
                  Online

                  31.7k
                  Users

                  79.8k
                  Topics

                  1.3m
                  Posts

                  3
                  7
                  1425
                  Loading More Posts
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes
                  Reply
                  • Reply as topic
                  Log in to reply
                  Community
                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                  The ioBroker Community 2014-2023
                  logo