PDA

View Full Version : Auto Restart DM500



lukasz
13-01-2012, 14:39
Hi,
How can i add auto-restart in DB500? OpenPLI has Cron?


Lukasz

Ricky
13-01-2012, 15:16
add as file reboot_timer.sh in map /var/script (chmod 755!!)

#!/bin/sh

strHour="04"
strMin="00"

while true
do
DateSTR=`date +%H%M%S`
#echo "$DateSTR"
if [ "$DateSTR" -ge "$strHour$strMin"00 ] && [ "$DateSTR" -le "$strHour$strMin"10 ]; then
echo "its time to reboot"
#shutdown -r now
reboot
exit 0
else
#echo "do sleeping"
sleep 8
fi
done

Add as inadyn_script.sh in map /var/script/

DYN_SYSTEM=dyndns@dyndns.org
/var/script/reboot_timer.sh &

test -f $DAEMON || exit 0

set -e

Reboot the dreambox and it should now auto reboot every night at 04 00

http://www.mediafire.com/?a2w80r1p9e4igke

lukasz
13-01-2012, 17:36
ok, thank you :) i musn't add this to cron? it's auto running? can i have 2 reboot in one day?
04:00 and 20:00?

Ricky
13-01-2012, 18:10
that will not go so it will require a 2nd process
perhaps someone has an idea

lukasz
13-01-2012, 18:42
it's not running :( i set 20:00 and DB wasn't reboot :(

Ricky
13-01-2012, 22:50
try this:

look at /var/script ..there is a crond_script.sh

edit like this

crond_on=1

then

make folders in var/etc/

named cron,and inside 1 more named crontabs

it have to look like this
/var/etc/cron/crontabs/root

put file named "root"

* 4 * * * reboot

restart every day at 4am!

lukasz
14-01-2012, 18:02
Ok, i mage file "root" in var/etc/cron/crontabs and write in this.

In var/script i have:
- crond_script.sh: crond_on=1
- reebot_timer.sh:
#!/bin/sh


strHour="20"
strMin="00"


while true
do
DateSTR=`date +%H%M%S`
#echo "$DateSTR"
if [ "$DateSTR" -ge "$strHour$strMin"00 ] && [ "$DateSTR" -le "$strHour$strMin"10 ]; then
echo "its time to reboot"
#shutdown -r now
reboot
exit 0
else
#echo "do sleeping"
sleep 8
fi
done
- inadyn_script.sh:
DYN_SYSTEM=dyndns@dyndns.org
/var/script/reboot_timer.sh &


test -f $DAEMON || exit 0


set -e


and it's not running:(

lukasz
14-01-2012, 21:07
it's not work :(

Ricky
14-01-2012, 22:53
no

/var/etc/cron/crontabs/root

this

* 4 * * * reboot

lukasz
15-01-2012, 10:16
it's not running :(

Ricky
15-01-2012, 12:10
crond is started automatically on boot?

lukasz
16-01-2012, 21:42
yes :)

Ricky
17-01-2012, 16:47
try it so again
- telnet to connect
- root@dream: echo "* 4 * * * /sbin/reboot" >> /etc/cron/crontabs/root
reboot
- root@dream: /etc/init.d/busybox-cron stop
- root@dream: /etc/init.d/busybox-cron start

lukasz
17-01-2012, 19:55
i have error: cannon create /etc/cron/crontabs/root: Directory nonexist :(

Ricky
19-01-2012, 08:02
look here
http://www.cardsharing.ws/cardsharing/showthread.php?32128-einfaches-CCcam-restart-Script

try this

lukasz
21-01-2012, 08:47
not doing :(