How to install Fonz's fun_plug on D-Link DNS-313

Useful informtion how to accomplish this and that.

How to install Fonz's fun_plug on D-Link DNS-313

Postby tim » Thu Jul 03, 2008 10:03 am

Before installing Fonz's fun_plug on your DNS-313 I assume you know what you are up to. For more information, visit the DNS-313 General discussion at http://forum.dsmg600.info/f9-DNS-313-Ge ... ssion.html.

1. Open up your favourite text editor (with support for Linux/Unix format text).
Using notepad.exe simply won't work. I used Notepad++ and converted the code to UNIX format.

Link: http://notepad-plus.sourceforge.net/

2. Creating the fun_plug script
Create the file /mnt/HD_a2/fun_plug with the following content:

Code: Select all
#!/bin/sh
#
# Fonz fun_plug v0.5 for DNS-313
# by TiM-International.net
#

# url to the install tarball
TARBALL_URL="http://www.inreto.de/dns323/fun-plug/0.5/fun_plug.tgz"

##################################################################

# dump kernel message buffer log
#dmesg > /mnt/HD_a2/dmesg.log

# write a session log, in case something goes wrong
exec >/mnt/HD_a2/ffp.log 2>&1

echo "**** fun_plug script for DNS-313 ****"
date

# download and install ffp
if [ ! -f /mnt/HD_a4/ffp/bin/busybox ]; then
   echo "* Downloading ffp 0.5..."
   wget $TARBALL_URL -O /mnt/HD_a2/fun_plug.tgz
    echo "* Extracting fun_plug.tgz..."
    mkdir -p /mnt/HD_a4/ffp && tar xzvf /mnt/HD_a2/fun_plug.tgz -C /mnt/HD_a4/ffp
    rm /mnt/HD_a2/fun_plug.tgz
fi

# create ffp link
echo "Binding ffp to /ffp"
mkdir -p /ffp
mount -o bind /mnt/HD_a4/ffp /ffp

# suid busybox
if [ -x /ffp/bin/busybox ]; then
    chown root.root /ffp/bin/busybox
    chmod 0755 /ffp/bin/busybox
    chmod u+s /ffp/bin/busybox
fi

# run commands
if [ -x /ffp/etc/rc ]; then
    echo "* Running /ffp/etc/rc ..."
    /ffp/etc/rc
    echo "*  OK"
else
    echo "/ffp/etc/rc: Not found or not executable"
fi

# always download the latest set of ffp packages
mkdir -p /mnt/HD_a2/packages
/ffp/bin/rsync -av inreto.de::dns323/fun-plug/0.5/packages /mnt/HD_a2


3. Reboot your NAS.
After the reboot Fonz's fun_plug will automatically be downloaded and installed.
tim
Site Admin
 
Posts: 238
Joined: Mon Apr 30, 2007 2:50 pm

Return to Articles, Guides, Tips, and Howtos

Who is online

Users browsing this forum: No registered users and 1 guest

cron