Register

Welcome to the RDI-Board Community.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


Donate Now Goal amount for this month: 100 EUR, Received: 100 EUR (100%)
Donate to support this site...

Results 1 to 3 of 3
  1. #1
    Member Mentor
    Join Date
    Jan 2003
    Posts
    725
    Posts Thanks / Likes

    Default Script restart dream / standby

    Doua scripturi pentru restartare dream si apoi trecere in standby:

    1.
    restart.sh
    wget -O /dev/null -q http://root: p [email protected]/web/powerstate?newstate=3

    2.
    standby.sh
    wget -O /dev/null -q http://root: p [email protected]/web/powerstate?newstate=0

    Editati cele doua files script cu parola fiecaruia, dati atrib 755 le puneti spre ex. in usr/script mergeti in Daemons/Cron dati add setati Time (ora minutul; sa zicem 5 : oo la restart si 5 : 05 standby) path-ul /usr/script/restart.sh respectiv usr/script/stanby.sh save si activare. Deci la ora cinci dimineata dreamul se va restarta singur si va trece automat in standby dupa cinci minute.

    Mai sunt si alte variante, dar asta mi s-a parut cea mai simpla. Desi tema este mai veche, sper ca va fi de folos si altora.

  2. #2
    In The Matrix Expert
    Join Date
    Oct 2005
    Location
    near Arad
    Posts
    1,311
    Posts Thanks / Likes

    Default

    pentru reboot merge si asa :

    init 4

    sleep 5

    reboot

  3. #3
    Gold Member Expert
    Join Date
    Feb 2005
    Posts
    4,738
    Posts Thanks / Likes

    Talking

    a).Simplu:

    "Reboot" (sau alte optiuni)testat/ functional pe imaginile E2:
    -Merlin;
    -Nemesis;
    Descarca de aici:
    restart_check.rar - 0.00MB

    si

    root.rar - 0.00MB

    Instaleaza plugin-ul Cronmanager, enigma2-plugin-extensions-cronmanager_0.2.2-r2_all.ipk - 0.01MB

    Scriptul-ul se pune, chmod 777, in: /usr/script/restart_check.sh

    Code:
    #!/bin/sh
    #
    # reboot dreambox when up for more than 24 hours and go to standby
    #
    # reboots only if the box isn't doing anything like:
    # - recording
    # - watching
    # - serving an active CCcam client
    #
    # you can run this script from cron with a line like this:
    #15 4 * * * /usr/script/restart_check.sh
    # now we reboot, finally
    # powerstate 0: Standby
    # 1: Deep standby
    # 2: Reboot Dreambox
    # 3: Restart Enigma2
    # 116: Wakeup from Standby
    wget -q http://127.0.0.1/web/powerstate?newstate=2 -O -
    }
    Crontab-ul se pune, chmod 777, in: /etc/cron/crontabs/root

    Code:
    15 4 * * * /usr/script/restart_check.sh
    Reboot-ul se va face la 04:15

    Apoi:
    Menu--->Plugins--->Cronmanager--->ok
    restart options--->start cron daemon--->ok

    b).Elegant/ complex: http://www.cccamforum.info/showthread.php?t=23980 [email protected]
    Script to reboot the dreambox every night
    I picked up a script from the internet that rebooted the dreambox every night.
    I was looking for something like this after experiencing hangs of cccam due to enigma running out of memory due to a massive memory leak triggered by crossepg.
    It would fill up the swap area and caused cccam to fail.

    I've modified the script for enigma2. The only bit I have not find a solution for is the check if the box is in recording mode.
    Save the script in /usr/script, set the execute permissions with chmod +x restart_check.sh
    and add something like this in root's contab entry,
    */5 3-5 * * * /usr/script/restart_check.sh


    Here is the script:


    #!/bin/sh
    #
    # reboot dreambox when up for more than 24 hours and go to standby
    #
    # reboots only if the box isn't doing anything like:
    # - recording
    # - watching
    # - serving an active CCcam client
    #
    # you can run this script from cron with a line like this:
    #*/5 3-5 * * * /usr/script/restart_check.sh
    # so it tries to reboot every 5 minutes between 3 and 6 a.m.
    #
    LOGFILE=/home/root/rebooted
    RCFILE=/etc/rc3.S99zzz
    #
    date >> $LOGFILE

    restart_box()
    {
    # create a script in /etc/rc2.d to put enigma to sleep after the reboot
    echo "#!/bin/sh
    sleep 120 && wget -q http://127.0.0.1/cgi-bin/admin?command=standby -O - &
    date >> $LOGFILE
    echo 'box rebooted' >> $LOGFILE
    rm -f $RCFILE > $RCFILE
    chmod 777 $RCFILE

    # log this restart
    echo "Restart box" >> $LOGFILE

    # now we reboot, finally
    # powerstate 0: Standby
    # 1: Deep standby
    # 2: Reboot Dreambox
    # 3: Restart Enigma2
    # 116: Wakeup from Standby
    wget -q http://127.0.0.1/web/powerstate?newstate=2 -O -
    }

    # we restart only if the box has been up for over a day
    uptime | fgrep day || exit
    echo "Passed uptime check" >> $LOGFILE

    # recording?
    # No option found yet to do this in enigma2!
    # wget -q http://127.0.0.1/cgi-bin/status -O - | fgrep -i recording | fgrep -i off || exit
    # echo "Passed Recording check" >> $LOGFILE

    # standby?
    wget -q http://127.0.0.1/web/powerstate -O - | fgrep -i true || exit
    echo "Passed Standby check" >> $LOGFILE


    # CCcam running?
    ps | fgrep -i cccam | fgrep -i camd || restart_box
    echo "Passed CCcam active check" >> $LOGFILE

    # no active CCcam clients?
    wget -q http://web:[email protected]:16001/activeclients -O - | fgrep "0 ACTIVE CLI" || exit
    echo "Passed CCcam active clients check" >> $LOGFILE
    restart_box

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Back to Top