DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-07-01 14:21:41

reebar
Member
Registered: 2008-05-22
Posts: 18

Autostarting twonky

Hi guys,

How do I get twonky to autostart? It has the starttwonky.sh scripts sitting in the default folder, not in the ffp/start one.

Thanks

Offline

 

#2 2008-07-01 17:03:05

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 148

Re: Autostarting twonky

this is the simple /ffp/start/twonky.sh script i made and am using it to autostart/start/stop twonky smile

Code:

#!/ffp/bin/sh

# PROVIDE: twonky
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr

name="twonky"
start_cmd="twonky_start"
stop_cmd="twonky_stop"
status_cmd="twonky_status"
log_file="/web/log/twonkymedia.log"

twonky_start()
{
        echo "Starting twonky..."
        route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0
        #/ffp/share/twonky/twonkymedia >$log_file 2>&1 &
        /ffp/share/twonky/twonkymedia &
        sleep 2
        echo "twonky started."
}

twonky_stop()
{
        if [ `twonky_temp_status` = "running" ]; then
                echo "Killing twonky..."
                killall twonkymedia
                sleep 2
                echo "twonky killed."
        else
                echo "Nothing to do..."
        fi
}

twonky_status()
{
        if [ -n "$(pidof twonkymedia)" ]; then
                echo "twonky running."
        else
                echo "twonky stopped."
        fi
}

twonky_temp_status()
{
        if [ -n "$(pidof twonkymedia)" ]; then
                echo "running"
        else
                echo "stopped"
        fi
}

run_rc_command "$1"

D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#3 2008-07-02 12:05:49

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: Autostarting twonky

nice script, how do i stop the server without having to do 'chmod a-x ..........' and restart the nas?

Offline

 

#4 2008-07-02 16:50:26

reebar
Member
Registered: 2008-05-22
Posts: 18

Re: Autostarting twonky

Hi SilentException. Thanks for the script. I copied it into notepad++ in unix format, saved it to the ffp/start directory, chowned it to root through an sftp connection and restarted the box but nothing...

Did you have to do anything else to get it going?

PS : I created the ffp/share/twonky directory will full privs.

Offline

 

#5 2008-07-02 17:22:20

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 148

Re: Autostarting twonky

doh, twonky has to be installed in /ffp/share/twonky

if you have it installed in other directory change it smile


@knireis:
if the script is +x you do
#/ffp/start/twonky.sh start
(to start)
#/ffp/start/twonky.sh stop
(to stop)
#/ffp/start/twonky.sh restart
(to restart)

if its not +x you can do it like:
#sh /ffp/start/twonky.sh start
...
...
...


D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#6 2008-07-03 04:53:23

reebar
Member
Registered: 2008-05-22
Posts: 18

Re: Autostarting twonky

All good now. I should have figured that out but....

Thanks

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB