Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Entwicklung
  4. Linux script zum resintallieren

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.0k

Linux script zum resintallieren

Scheduled Pinned Locked Moved Entwicklung
7 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • BluefoxB Offline
    BluefoxB Offline
    Bluefox
    wrote on last edited by
    #1

    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
    0
    • S Offline
      S Offline
      steinwedel
      wrote on last edited by
      #2

      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
      0
      • BluefoxB Offline
        BluefoxB Offline
        Bluefox
        wrote on last edited by
        #3

        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
        0
        • BluefoxB Offline
          BluefoxB Offline
          Bluefox
          wrote on last edited by
          #4

          @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
          0
          • Jey CeeJ Online
            Jey CeeJ Online
            Jey Cee
            Developer
            wrote on last edited by
            #5

            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
            
            

            Persönlicher Support
            Spenden -> paypal.me/J3YC33

            1 Reply Last reply
            0
            • BluefoxB Offline
              BluefoxB Offline
              Bluefox
              wrote on last edited by
              #6

              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
              0
              • BluefoxB Offline
                BluefoxB Offline
                Bluefox
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Support us

                ioBroker
                Community Adapters
                Donate

                608

                Online

                32.4k

                Users

                81.4k

                Topics

                1.3m

                Posts
                Community
                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                ioBroker Community 2014-2025
                logo
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Unread 0
                • Categories
                • Unreplied
                • Popular
                • GitHub
                • Docu
                • Hilfe