Update Download unter Linux: Error Line 140

Update Download unter Linux: Error Line 140

Postby p5ych0 » 28.02.2011, 20:31

Hi zusammen,

ich verwende ein NAS von Synology, dass mit Linux betrieben wird.
Ich möchte gerne das DownloadUpdates.sh Script als Cronjob einmal die Woche laufen lassen.
Beim manuellen Starten des Scripts bekomme ich aber folgenden Fehler:

./CreateISOImage.sh: line 140: syntax error: unexpected "(" (expecting "}")

Das selbe Problem habe ich auch bei CreateISOImage.sh

./CreateISOImage.sh: line 90: syntax error: unexpected "(" (expecting "}")

Zum erstellen des ISOs habe ich bereits das Paket mkisofs nachinstalliert (ist im Paket "cdrtools" enthalten).

Fehlt mir hier noch ein bestimmtes Paket? oder was anderes?

Chmod habe ich für beide Scripte natürlich schon gesetzt...WSUS Offline hat die Version 6.8.1

Danke euch!

*nachtrag*
Hier hätte ich noch nen Beitrag aus dem Forum des NAS Herstellers...schon etwas älter...aber das Problem ist das Selbe!
Ein paar Leute haben das wohl 'fast' zum Laufen bekommen.

http://www.synology-forum.de/showthread ... te-Sammler

Mit der Bitte um Hilfe....
Last edited by -Iwan- on 01.03.2011, 07:16, edited 1 time in total.
Reason: Doppelpost zusammengeführt
p5ych0
 

Re: Update Download unter Linux: Error Line 140

Postby -Iwan- » 01.03.2011, 07:15

Guten morgen,

zum eine sehe ich nicht, das es da "fast" einer zum laufen gebracht hat, zum andern ist auf den NAS nun mal kein "vollwertiges" Linux drauf.
Werden denn die Updates überhaupt geladen oder was funktioniert und was nicht?
-Iwan-
 
Posts: 364
Joined: 02.11.2009, 17:49
Location: NRW, Germany

Re: Update Download unter Linux: Error Line 140

Postby boco » 01.03.2011, 09:17

ist auf den NAS nun mal kein "vollwertiges" Linux drauf.
Richtig. Ich habe auch so'n Ding (IcyBox), und das Linux (benutzt busybox) ist optimiert auf das was das NAS soll: Daten- und manchmal auch Streaming-Dienste. Da der Kernel auch auf einem (zumindest ist es bei mir so) Nur-Lese-Medium gespeichert ist, kann man nur sehr beschränkt Pakete (über ipkg) nachinstallieren. Vermutlich sind Kernel-Patches oder -Rekompilierung schwer bis gar nicht möglich.

Das Problem selbst ist wahrscheinlich, daß die Linux-Tools in dem Synology wohl auch busybox-Versionen (oder ähnliche embedded-Lösungen) sind. Diese Befehle unterstützen nicht alle Parameter ihrer großen Brüder.
Microsoft update catalog: http://catalog.update.microsoft.com/v7/site/
Windows Install media download: https://support.microsoft.com/en-us/help/15088/windows-create-installation-media
boco
 
Posts: 2391
Joined: 24.11.2009, 17:00
Location: Germany

Re: Update Download unter Linux: Error Line 140

Postby p5ych0 » 02.03.2011, 09:20

Guten Morgen,

erstmal sorry für meine späte Antwort!
ja, das ist alles klar. da ist busybox drauf...allerdings kann ich einiges nachinstallieren.
auch kompilieren kann ich auf der kiste...müsste halt gcc installieren:) das os ist auf den internen platten installiert :) da gibts nichts mit read only :)

also downloaden kann ich mit dem script nicht. es bricht davor schon ab.
hab mir die betroffene zeilen angeschaut...irgendwie mag er die klammern in zeile 140 nicht!

Code: Select all
...
syslist=("wxp" "wxp-x64" "w2k3" "w2k3-x64" "w60" "w60-x64" "w61" "w61-x64" "all-x64" "all-x86")
...


danach kommen noch ein paar solche zeilen...wahrscheinlich machen die dann auch noch probleme!
habt ihr noch ne idee? wäre echt ne klasse sache, wenn das laufen würde!
p5ych0
 

Re: Update Download unter Linux: Error Line 140

Postby -Iwan- » 02.03.2011, 15:26

Wenn die Zeile 140 mit der Fehlermeldung von ganz oben zusammenhängt, dann erwartet das System statt den runden Klammer ( ) nun mal andere { }.
Ein Austausch in den angemeckerten Zeilen könnte ggfs. das Problem lösen. Zumindest ist es einen Versuch wert ;)
-Iwan-
 
Posts: 364
Joined: 02.11.2009, 17:49
Location: NRW, Germany

Re: Update Download unter Linux: Error Line 140

Postby Snigel » 10.03.2011, 10:56

edit: solved my errors, my problem was that I was invoking the script with sh instead of making it exucutable.

I'm on ubuntu server, running bash, still getting the same errors even though I'm on a full Linux distribution without busybox.

Changing () to {} solves a lot of problems in the file and there are a lot more places than just line 140.

After this is changed, some errors regarding if statements appears, like "[: 488: unexpected operator"

To fix this one should change double == to single = according to
http://stackoverflow.com/questions/2011 ... ator-error

This does not repair the file though, now it complains about line 266
let syschoice=syschoice-1

According to http://tldp.org/LDP/abs/html/internal.html the let command is not needed here, so I removed it.

Now it complains about bad substition on line 430, line 430 is just "fi" but I can see that the error appears after it parses the first line in this loop at line ~268

Code: Select all
for i in ${!syslist[@]}; do
        if [ "$syschoice" = "$i" ]; then
                sys=${syslist[i]}
        fi
done


Running echo commands before and after the first line shows that the error appears on the first line.

This is what syslist look like by the way
Code: Select all
syslist={"wxp" "wxp-x64" "w2k3" "w2k3-x64" "w60" "w60-x64" "w61" "w61-x64" "all-x64" "all-x86"}
Snigel
 


Return to Linux

Who is online

Users browsing this forum: Google [Bot] and 30 guests