View Single Post
  #369  
Old 10.01.2020, 13:17
tt_1111 tt_1111 is offline
Linkgrabbing Monster
 
Join Date: Apr 2011
Posts: 86
Default

Habe inzwischen eine Lösung gefunden.

Die JDownloader2.sh muss editiert werden. Auf meinem TS-332x:

/share/CACHEDEV1_DATA/.qpkg/JDownloader2/JDownloader2.sh

Wichtig: Es muss der (permanente) Speicherort sein. In
/etc/init.d
wird bei jedem Reboot eine Kopie erzeugt – auf einer RAMDisk. Die nach Ausschalten natürlich wieder weg ist. Der o.g. Speicherort auf CACHEDEV1_DATA ist das Original. Auf NAS mit anderen CPUs mag der Speicherort abweichen; es ist aber immer das permanente Original und nicht die Kopie in /etc/init.d zu nehmen. Ggf. einmal in der Putty-Session suchen:

find / -name JDownloader2.sh

Dauert eine Weile, listet dafür alle Vorkommen der Datei auf.

Folgende Änderungen in der JDownloader2.sh sind nötig:

Code:
PackageCheck(){ #Does /opt exist? if not check if it's optware that's installed or opkg, and start the package 
  /bin/echo -n " Checking for installed package..."
  if [ -x /opt/bin/ipkg ]; then #if optware
      /opt/bin/ipkg update
      /opt/bin/ipkg install grep sed procps bc bash coreutils
      sleep 2
      /bin/echo "  Done!"
  elif [ -x /etc/init.d/Entware-ng.sh ]; then #if Entware-ng
      /opt/bin/opkg update
      /opt/bin/opkg install grep sed procps-ng procps-ng-w bc bash coreutils coreutils-cat coreutils-tail coreutils-ln coreutils-mkdir
      sleep 2
      /bin/echo "  Done!"
  elif [ -x /etc/init.d/Entware.sh ]; then #if Entware (new)
      /opt/bin/opkg update
      /opt/bin/opkg install grep sed procps-ng procps-ng-w bc bash coreutils coreutils-cat coreutils-tail coreutils-ln coreutils-mkdir
      sleep 2
      /bin/echo "  Done!"
  else #catch all
      /bin/echo "  No Optware or Opkg or Entware-ng or Entware (new) found, please install one of them" 
      /sbin/write_log "I can't install required package, it's depend from Optware or Opkg or Entware-ng or Entware (new). Please re-install one of those packages" 1 
      exit 1
  fi
  }

CheckForOpt(){ #Does /opt exist? if not check if it's optware that's installed or opkg, and start the package 
  /bin/echo -n " Checking for /opt..."
  if [ ! -d /opt/bin ]; then
    if [ -x /etc/init.d/Optware.sh ]; then #if optware ,start optware
      /bin/echo "  Starting Optware..."
      /etc/init.d/Optware.sh start
      sleep 2
    elif [ -x /etc/init.d/opkg.sh ]; then #if opkg, start opkg  
      /bin/echo "  Starting Opkg..."    
      /etc/init.d/opkg.sh start
      sleep 2
    elif [ -x /etc/init.d/Entware-ng.sh ]; then #if Entware-ng, start Entware-ng  
      /bin/echo "  Starting Entware-ng..."    
      /etc/init.d/Entware-ng.sh start
      sleep 2
    elif [ -x /etc/init.d/Entware.sh ]; then #if Entware (new), start Entware  
      /bin/echo "  Starting Entware..."    
      /etc/init.d/Entware.sh start
      sleep 2
    else #catch all
      /bin/echo "  No Optware or Opkg or Entware-ng or Entware (new) found, please install one of them"    
      /sbin/write_log "Failed to start $QPKG_NAME, no Optware or Opkg or Entware-ng or Entware (new) found. Please re-install one of those packages" 1 
      exit 1
    fi
  else
    /bin/echo "  Found!"
  fi
  }
Es wurde jeweils ein elif-Abschnitt eingefügt, der fragt, ob Entware.sh existiert.

Das Editieren kann man entweder mit einer putty-Session mittels vi auf dem NAS selbst vornehmen – seeeehr umständlich für Dummies, die einen grafischen Editor gewohnt sind.

Oder man kopiert die Datei auf eine öffentliche Freigabe und editiert sie dort mit einem Editor seiner Wahl. Dabei muss allerdings unbedingt darauf geachtet werden, dass die Zeilenumbrüche einfach ein <LF> (und nicht wie auf Windows sonst üblich <CR><LF>) sind. Z.B. in Notepad++ kann man sich auch sämtliche Sonderzeichen anzeigen lassen.

Im Textmodus zurückkopieren nach CACHEDEV1_DATA und anschließend ausführbar machen.
chmod +x ./JDownloader2.sh

Nach dem nächsten Restart sollte der JDownloader auch dann gestartet sein, wenn das neue Entware-Paket (und nicht das alte Entware-ng) installiert ist.

Viel Spaß!
Reply With Quote