Skip to content
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • 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

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker 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.1k

Linux script zum resintallieren

Geplant Angeheftet Gesperrt Verschoben Entwicklung
7 Beiträge 3 Kommentatoren 1.5k Aufrufe
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • BluefoxB Offline
    BluefoxB Offline
    Bluefox
    schrieb am zuletzt editiert von
    #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 Antwort Letzte Antwort
    0
    • S Offline
      S Offline
      steinwedel
      schrieb am zuletzt editiert von
      #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 Antwort Letzte Antwort
      0
      • BluefoxB Offline
        BluefoxB Offline
        Bluefox
        schrieb am zuletzt editiert von
        #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 Antwort Letzte Antwort
        0
        • BluefoxB Offline
          BluefoxB Offline
          Bluefox
          schrieb am zuletzt editiert von
          #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 Antwort Letzte Antwort
          0
          • Jey CeeJ Online
            Jey CeeJ Online
            Jey Cee
            Developer
            schrieb am zuletzt editiert von
            #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 Antwort Letzte Antwort
            0
            • BluefoxB Offline
              BluefoxB Offline
              Bluefox
              schrieb am zuletzt editiert von
              #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 Antwort Letzte Antwort
              0
              • BluefoxB Offline
                BluefoxB Offline
                Bluefox
                schrieb am zuletzt editiert von
                #7

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

                1 Antwort Letzte Antwort
                0
                Antworten
                • In einem neuen Thema antworten
                Anmelden zum Antworten
                • Älteste zuerst
                • Neuste zuerst
                • Meiste Stimmen


                Support us

                ioBroker
                Community Adapters
                Donate

                637

                Online

                32.4k

                Benutzer

                81.4k

                Themen

                1.3m

                Beiträge
                Community
                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                ioBroker Community 2014-2025
                logo
                • Anmelden

                • Du hast noch kein Konto? Registrieren

                • Anmelden oder registrieren, um zu suchen
                • Erster Beitrag
                  Letzter Beitrag
                0
                • Aktuell
                • Tags
                • Ungelesen 0
                • Kategorien
                • Unreplied
                • Beliebt
                • GitHub
                • Docu
                • Hilfe