vdrshutdown optimieren


  • bwnutze

    Code
    diff oldscript newscript


    Zitat

    jetzt hab ich noch ein problem:


    das svdrpsend wird ausgeführt das anschließende exit 1 aber nicht.


    bei mir gehts: Ich lasse in einem anderen Fenster top laufen,
    dann

    Code
    pgrep top && (echo hello; echo world)

    und es geht:
    wenn top laeuft, kommt hello world raus. Wenn top nicht laeuft, kommt gar nichts raus.

  • Zitat

    Original von Bistr-o-Math


    bei mir gehts: Ich lasse in einem anderen Fenster top laufen,
    dann

    Code
    pgrep top && (echo hello; echo world)

    und es geht:
    wenn top laeuft, kommt hello world raus. Wenn top nicht laeuft, kommt gar nichts raus.


    hab's gerade von einem Skript aus probiert. Es geht nicht. Habe in man bash nachgeschlagen,
    es ist auch nicht gedacht zu funktionieren, da die Befehle in ( ) in einer subshell ausgefuehrt werden. D.h. exit 1 verlaesst nur diese subshell und nicht das Skript.


    Die loesung ist: benutze { }:

    Code
    pgrep top && { echo hello; echo world; exit 1; }


    Dabei muessen { und } durch leerzeichen vom Rest abgetrennt sein und auch der letzte Befehl muss mit einerm Semikolon abschliessen.

  • Zitat

    Original von RaK


    Weil ein Script das vom VDR intern aufgerufen wird (commands.conf, vdrshutdown, ...) wenn es
    über svdrpsend.pl auf den VDR wieder zugreifen will total haengt. das geht aber über at.


    kann jemand erklaeren, warum es haengt? Wer wartet auf wen? Das sieht irgendwie nach einem Bug aus. Bloss wo?

  • vielen vielen dank. es funktioniert.


    Zitat

    Original von Bistr-o-Math
    [bwnutze

    Code
    diff oldscript newscript


    also das diff liefert keinenn unterschied der den fehler erklären würde, oder hab ich was übersehen:


    3c3,5
    < #pgrep 2divx && (/usr/local/src/VDR/svdrpsend.pl MESG Divx-Konvertierung läuft noch; exit 1)
    ---
    >
    > pgrep 2divx && { /usr/local/src/VDR/svdrpsend.pl MESG Divx-Konvertierung läuft noch ;exit 1; }
    >
    5c7,21
    < $NVRAMCMD -ls $1
    ---
    > $NVRAMCMD -ls $1
    >
    > case $PIPESTATUS in
    > 0) # all went ok - new date and time set
    > #shutdown -h now
    > EXITSTATUS=0
    > ;;
    > 1) # all went ok - new date and time set.
    > #
    > # *** but we need to reboot. ***
    > #
    > # for some boards this is needed after every change.
    > #
    > # for some other boards, we only need this after changing the
    > # status flag, i.e. from enabled to disabled or the other way.
    7,26c23,28
    < case $PIPESTATUS in
    < 0 ) # all went ok - new date and time set
    < #shutdown -h now
    < EXITSTATUS=0
    < ;;
    < 1 ) # all went ok - new date and time set.
    < #
    < # *** but we need to reboot. ***
    < #
    < # for some boards this is needed after every change.
    < #
    < # for some other boards, we only need this after changing the
    < # status flag, i.e. from enabled to disabled or the other way.
    <
    <
    < # For plan A - (Plan A is not supported anymore---see README)
    < #
    < # For plan B - (don't forget to install the modified kernel image first)
    < #
    <
    ---
    >
    > # For plan A - (Plan A is not supported anymore---see README)
    > #
    > # For plan B - (don't forget to install the modified kernel image first)
    > #
    >
    29,37c31,39
    < quit" | grub --batch
    <
    < #shutdown -r now
    < EXITSTATUS=0
    < ;;
    < 2 ) # something went wrong
    < # don't do anything - just exit with status 1
    < EXITSTATUS=1
    < ;;
    ---
    > quit" | grub --batch
    >
    > #shutdown -r now
    > EXITSTATUS=0
    > ;;
    > 2) # something went wrong
    > # don't do anything - just exit with status 1
    > EXITSTATUS=1
    > ;;
    40c42
    < echo "VDR-Shutdown!!!"
    ---
    > echo "VDR-Shutdown"


    cu atosch

  • Zitat

    Original von atosch
    vielen vielen dank. es funktioniert.


    schoen. :]



    benutze bitte

    Code
    diff -b oldscript newscript


    Die Option -b unterdrueckt Unterschiede, die nur in Leerzeichen bestehen. Alternativ kannst du die Datei als Attachment anhaengen. Dann kann ich evtl. rauskriegen, wo der Fehler war/ist.

  • zu spät. ich hab die doofe datei schon gelöscht. da es ja jetzt funktioniert hab ich den vorfall einfach als unverständlich/mysteriös abgehackt. nochmal danke für deine hilfe.


    cu atosch

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!