Seite 2 von 2 ErsteErste 12
Ergebnis 11 bis 17 von 17
  1. #11

    Registriert seit
    27.04.2020
    Beiträge
    1.485
    Thanks (gegeben)
    300
    Thanks (bekommen)
    1098
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke


    •   Alt Advertising

       

  2. #12
    Avatar von Pike_Bishop
    Registriert seit
    11.02.2020
    Ort
    here and there
    Beiträge
    2.444
    Thanks (gegeben)
    650
    Thanks (bekommen)
    1661
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    Box 1:
    Mutant HD2400
     
     
    Box 2:
    VU Ultimo 4K
     
     
    Box 3:
    Octagon SF8008
     
     
    Box 4:
    Gigablue Quad 4K
     
     
    Box 5:
    VDR
     
     
    Hi,

    @pmdymidowski

    first try this (simple improvements - if we have luck that is enough and it works);
    Code:
    #!/bin/sh
    
    BOXIP=http://localhost
    WGET=/usr/bin/wget
    LOGDIR=/var/log
    LOGFILE=$LOGDIR/autoupd_system.log
    
    # General Logging.
    exec 3>&1 4>&2
    trap 'exec 2>&4 1>&3' 0 1 2 3
    exec 1>$LOGFILE 2>&1
    
    echo -e "\nChecking for system updates, please wait...\n"
    opkg update > /dev/null
    #opkg list-upgradable | grep - > /dev/null  # i think you didn't need this line the following if line does the job.
    
    if ! /usr/bin/opkg list-upgradable | grep - > /dev/null; then
    	echo -e "\nThe system is up to date.\n"
    else
    	echo -e "\nThe system is being updated, please wait..."
    	$WGET -O - -q "$BOXIP/web/message?text=Trwa%20aktualizacja%20dekodera%2C%20prosze%20czekac%2E%2E%2E&type=1&timeout=12" > /dev/null && sleep 2
    	echo "-------------------"
    	DATE="$(date +%F_%T)"
    	echo $DATE
    	echo -e "-------------------\n"
    	opkg upgrade
    	
    	if [ "$?" = "0" ] ; then
    		echo -e "\nThe system has been updated, restarting...\n"
    		$WGET -O - -q "$BOXIP/web/message?text=Dekoder%20zostal%20zaktualizowany%2C%20trwa%20ponowne%20uruchamianie%2E%2E%2E&type=1&timeout=12" > /dev/null && sleep 10
    	else
    		echo -e "\nAn error occurred while updating the system, check the network connection.\n"
    		#$WGET -O - -q "$BOXIP/web/message?text=Wystapil%20blad%20podczas%20aktualizacji%20dekodera%2C%20sprawdz%20polaczenie%20sieciowe%2E&type=3&timeout=20" > /dev/null && sleep 2
    		$WGET -O - -q "$BOXIP/web/message?text=Wystapil%20blad%20podczas%20aktualizacji%20dekodera%2C%20sprawdz%20polaczenie%20sieciowe%2E&type=3" > /dev/null
    		exit 1
        fi
    	
    	#reboot
    	$WGET -q -O - $BOXIP/web/powerstate?newstate=2
    fi
    
    opkg clean
    
    exit 0
    i have build in general logging so you didn't need commands as;
    echo "-------------------" >> $LOGFILE
    anymore - the following is enough then instead;
    echo "-------------------"

    instead of reboot i use now $WGET -q -O - $BOXIP/web/powerstate?newstate=2 and i think you didn't need a reboot if the script fails (line 31 in the new script)
    so in this case the script exits with exit 1 and no reboot.
    the messages about webif (wget) are now with timeouts only the error message didn't have a timeout so that you can see this message later if you are not before your box
    i maked also a bit cosmetic changes so that the script and the logfile too is better readable.
    it's up to you to test it because i didn't




    @Mr.Servo

    Zitat Zitat von Mr.Servo Beitrag anzeigen
    Hi Pike!

    Na ich vermute mal weil der API-Messagetext gemäß Tante Google so lautet:

    Dekoder został zaktualizowany, trwa ponowne uruchamianie.
    Der Decoder wurde aktualisiert und neu gestartet.

    Wystąpił błąd podczas aktualizacji dekodera, sprawdź połączenie sieciowe.
    Beim Aktualisieren des Decoders ist ein Fehler aufgetreten. Überprüfen Sie die Netzwerkverbindung.

    Gruß.....Mr.Servo
    Hmm, na ja so mancher bezeichnet nen Satreceiver aber doch als Decoder (sagt für mich nach wie vor nix bezgl. nem Cam aus).
    Und ich schreib das ja nicht zum Spass es deutet ja auch im Script selbst nix darauf hin und da red ich jetzt auch von den Befehlen her.
    Um es genauer auszuführen; das Script macht in den Grundzügen eigentlich nur das;
    1.) Die Paketliste aktualisieren also das -> opkg update
    2.) Gucken obs überhaupt Updates gibts also das -> opkg list-upgradable | grep -
    3.) Und dann falls es Updates gibt wird upgedatet also das gemacht -> opkg upgrade

    Der Rest sind Logging in ne Datei, sowie Abfragen ob der Hauptbefehl geklappt hat mit Fallunterscheideung also ja oder nein mit entsprechender Reaktion darauf, und natürlich OSD Nachrichten
    dazu.



    Grüsse
    Pike
    Geändert von Pike_Bishop (21.01.2021 um 23:30 Uhr)

  3. Thanks -, Mr.Servo, Ja5 bedankten sich
  4. #13
    Avatar von Mr.Servo
    Registriert seit
    10.08.2020
    Ort
    Pfalz / Palatinate
    Beiträge
    2.656
    Thanks (gegeben)
    1811
    Thanks (bekommen)
    2434
    Total Downloaded
    56,91 MB
    Total Downloaded
    56,91 MB
    ReceiverDanke
    Box 1:
    GigaBlue UHD UE 4k Cable (openATV 7.4)
     
     
    Box 2:
    Mut@nt HD51 4k Cable (oATV DEVEL)
     
     
    Danke Pike!

    Nichts für Ungut, da war ich vielleicht etwas "zu ambitioniert". Aber wir immer: Gut gemeint ist eben nicht gut gemacht!

    Danke Dir für das Anpassen des Skripts und die begleitenden Erklärungen. Da kann man sich immer mal was abgucken...

    Gruß......Mr.Servo

  5. Thanks Pike_Bishop bedankten sich
  6. #14
    Avatar von Pike_Bishop
    Registriert seit
    11.02.2020
    Ort
    here and there
    Beiträge
    2.444
    Thanks (gegeben)
    650
    Thanks (bekommen)
    1661
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    Box 1:
    Mutant HD2400
     
     
    Box 2:
    VU Ultimo 4K
     
     
    Box 3:
    Octagon SF8008
     
     
    Box 4:
    Gigablue Quad 4K
     
     
    Box 5:
    VDR
     
     
    Hi Mr.Servo

    Zitat Zitat von Mr.Servo Beitrag anzeigen
    Danke Pike!

    Danke Dir für das Anpassen des Skripts und die begleitenden Erklärungen. Da kann man sich immer mal was abgucken...

    Gruß......Mr.Servo
    Danke - das hört man gern


    Grüsse
    Pike

  7. #15
    Anfänger
    Registriert seit
    19.01.2021
    Beiträge
    5
    Thanks (gegeben)
    0
    Thanks (bekommen)
    0
    Themenstarter
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    The script will be added to cron. Should it be autoupd_system or autoupd_system.sh? Is an additional parameter required or just add an entry to root?

  8. #16
    Avatar von Pike_Bishop
    Registriert seit
    11.02.2020
    Ort
    here and there
    Beiträge
    2.444
    Thanks (gegeben)
    650
    Thanks (bekommen)
    1661
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    Box 1:
    Mutant HD2400
     
     
    Box 2:
    VU Ultimo 4K
     
     
    Box 3:
    Octagon SF8008
     
     
    Box 4:
    Gigablue Quad 4K
     
     
    Box 5:
    VDR
     
     
    use it as autoupd_system.sh, put it on your box to /usr/script and then make the cronjob.
    as example the cronjob can looks as following then;
    Code:
    * * * * * sh /usr/script/autoupd_system.sh
    but i don't know how often you need this job, and at what time.

    you can do the cronjob with telnet command as following (it's only a example, you need to adjust the parameters for cron in this case the * * * * * in the command;
    Code:
    (crontab -l 2>/dev/null; echo "* * * * * sh /usr/script/autoupd_system.sh") | crontab -
    this makes an entry to root.

  9. #17
    Avatar von Pike_Bishop
    Registriert seit
    11.02.2020
    Ort
    here and there
    Beiträge
    2.444
    Thanks (gegeben)
    650
    Thanks (bekommen)
    1661
    Total Downloaded
    0
    Total Downloaded
    0
    ReceiverDanke
    Box 1:
    Mutant HD2400
     
     
    Box 2:
    VU Ultimo 4K
     
     
    Box 3:
    Octagon SF8008
     
     
    Box 4:
    Gigablue Quad 4K
     
     
    Box 5:
    VDR
     
     
    Hi pmdymidowski,

    current version looks now as following (it's only for integrity in the forum, because it's the same version as in my last pn);
    Code:
    #!/bin/sh
    
    BOXIP=http://localhost
    WGET=/usr/bin/wget
    LOGDIR=/var/log
    LOGFILE=$LOGDIR/autoupd_system.log
    DATE="$(date +%F_%T)"
    
    # General Logging.
    exec 3>&1 4>&2
    trap 'exec 2>&4 1>&3' 0 1 2 3
    exec 1>$LOGFILE 2>&1
    
    echo -e "\n-------------------"
    echo $DATE
    echo -e "-------------------\n"
    
    echo -e "\nChecking for system updates, please wait...\n"
    opkg update
    
    if ! /usr/bin/opkg list-upgradable | grep - ; then
    	echo -e "\nThe system is up to date.\n"
    else
    	echo -e "\nThe system is being updated, please wait..."
    	$WGET -O - -q "$BOXIP/web/message?text=Trwa%20aktualizacja%20dekodera%2C%20proszę%20czekać%2E%2E%2E&type=1&timeout=12" > /dev/null && sleep 2
    	opkg upgrade
    	
    	if [ "$?" = "0" ] ; then
    		echo -e "\nThe system has been updated, restarting...\n"
    		$WGET -O - -q "$BOXIP/web/message?text=Dekoder%20został%20zaktualizowany%2C%20trwa%20ponowne%20uruchamianie%2E%2E%2E&type=1&timeout=12" > /dev/null && sleep 10
    	else
    		echo -e "\nAn error occurred while updating the system, check the network connection.\n"
    		#$WGET -O - -q "$BOXIP/web/message?text=Wystąpił%20błąd%20podczas%20aktualizacji%20dekodera%2C%20sprawdź%20połączenie%20sieciowe%2E&type=3&timeout=20" > /dev/null && sleep 2
    		$WGET -O - -q "$BOXIP/web/message?text=Wystąpił%20błąd%20podczas%20aktualizacji%20dekodera%2C%20sprawdź%20połączenie%20sieciowe%2E&type=3" > /dev/null
    		exit 1
    	fi
    	
    	#reboot
    	$WGET -q -O - $BOXIP/web/powerstate?newstate=2
    fi
    
    opkg clean
    
    exit 0

    regards
    Pike
    Geändert von Pike_Bishop (23.01.2021 um 21:17 Uhr)


Seite 2 von 2 ErsteErste 12

Stichworte

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:24 Uhr.
Powered by vBulletin® Version 4.2.5 (Deutsch)
Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.
Resources saved on this page: MySQL 5,88%
Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)
vBulletin Skin By: PurevB.com