#!/bin/sh

# switch to safe working directory on ramdisk
cd /

# write a log, in case sth goes wrong
FFP_LOG=/home/Public/ffp.log
#FFP_LOG=/dev/null
exec >>$FFP_LOG 2>&1

# real path to ffp
FFP_PATH=/home/Public/rootfs/ffp

# where to search for the install tarball
FFP_TARBALL=/home/Public/fun_plug.tgz

# rc file path
FFP_RC=/home/Public/ffp/etc/rc


echo "**** fun_plug script for CH3MNAS ****"
date

# install tarball
if [ -r $FFP_TARBALL ]; then
    echo "* Installing $FFP_TARBALL ..."
    mkdir -p $FFP_PATH && tar xzf $FFP_TARBALL -C $FFP_PATH 
    if [ $? -eq 0 ]; then
        echo "* OK"
    fi
    rm $FFP_TARBALL
fi

