Gerrards Cross Computer Club

ICY NAS-Box 4220
Install userscripts Package

Return to support page home

Page updated 13 July 2008

Contents of This Page

  1. ICY NAS-Box 4220 Install userscripts Package
    1. Contents of This Page
    2. Overview
    3. How does it Work
    4. Install the Package</a>
    5. What Do We Have Now?
    6. External Links
    7. Acknowlegements

If you are in a hurry go straight to Install the Package

Overview

The ICY Box 4220 is a NAS storage device. It will be referred to a the NAS in the rest of this docuYou don't need to understand this bit to install the package.ment. 

The NAS is built using a LINUX derivative, Betterbox. If the standard functionality provided by Raidsonic is sufficient then procede no further - this page is not for you. You do not need this package. However as you are here you may be considering enhancing the functionality, perhaps as a workaround for the spindown issues then read on.

Although familiar with Windows for many years I have only a passing acquaintance  with UNIX/LINUX and found the process difficult to understand. This page attempts to set the process down step by step so that anyone (even me) can do it without any knowledge of UNIX/LINUX.

How does it Work

You don't need to understand this bit to install the package.

ThE NAS uses a derivative of UNIX/LINUX called BusyBox. UNIX derivatives use a variety of "script" files to control the startup and running of the sytem. This scripts can be executed (run) as if they are programs and can call on programs or other scripts. There several scripts that control startup to decide, how to boot (start) up the sytem i.e where to load the operating system from, how to initialise devices etc. BusyBox ot perhaps Radsonic (whoe designed the NAS) provide a script to enable the basic software to updated. This is equivalent to patching a Windows Operation System. The mechanism can also be utilised for installing additional software packages. The userscripts package is one such installation.

This link describes how the standard /etc/rc.pkg.start script works. This script depends on a folder new_software which exists under the pubic share /public/applications.

Installation of userscripts causes a folder structure (described below) to be created within the folder /public/applications which contains a file, marked as executable, called init. This will be called on the next reboot and will initiate all script procesing within the usrscript folder.

A typical use (described in the example files) is to modify the FTP security.

Install the Package

Just follow the following steps:

Step Action to be performed
1 Download installation package from http://rapidshare.de/files/38401656/userscript_0.21_080125.tgz.html to your PC
2 Copy the package from your PC to the public NAS share - choose folder  applications\new-software on your NAS box.
3 Reboot NAS either from front panel button, or through the web interface

Thats it!

What Do We Have Now?

Installation and reboot causes a folder userscripts to be created on the public NAS sha

External Links

There is a forum, largely in German, for discussions on the NAS-4220. There is an English section however and the creator of this excellent add-on (Skara) descibes how to use it. The link is here http://forum.nas-portal.org/showthread.php?t=696&highlight=userscript.

There is also a Wiki describing the script here http://en.nas-4220.org/index.php/Packages:userscript )in English).

re under the folder applications.

This folder contains two files and a number of folders. The contents of these will be described in a moment.

First however a note about editing these files. They are in UNIX format and care needs to be taken to edit these correctly using Windows tools. UNIX uses different end of line characters to Windows. Fortunately there is a simple solution - use Notepad++. This can be found here.

Secondly - script files must all start with a standard bit of UNIX magic. the first line must begin as shown below. This tells UNIX that it is a SHell script file. Most files should have a file extension .sh. The file must also be made executable but more on that later.

#!/bin/sh
#

The following table shows the structure of the public\applications folder. Note that Windows path separators are shown. Unix users will be aware that on UNIX systems this uses a forward slash rather than a reverse slash character. Entries enclosed on <...> are placeholders for real files

Folder \Folder [\folder]\file Description
applications\ new_software\ <package> Place new NAS-4220 installation package in here. This will be a .tgz file. It will be installed on the next reboot.

The file placed in here will be deleted so it is suggested that you keep a copy!
userscript
   

Folder that will contain the example scripts. Note that other folders can be created at this level and can themselves contain instances of the files/folders below.
init General initialisation script which is called as the NAS boots up
init.us Final general initialisation script if required. This is run at the end of the boot process.
config\     Folder to contain any configuration data required by other scripts e.g. proftpd.sh uses proftpd.config.
<conf> One or more files holding configuration data.
scripts\ Folder that will contain scripts to be run. This is initially empty.
<script.sh> One or more files containing scripts. It is more convenient to have multiple scripts, each performing a single function as hese are self contained and hence easier to test and maintain.
example <files>
<folders>

A set of example script files. These include a script file for customising FTP configuration. This will need to be tailored to suit your preferences. This folder also contains a folder with example config files held in a config folder.
<othersc</a>ript>\         Further folders can be added to the applications folder. An example of this is the usb-system folder which contains the tweak to remount the system onto a USB stick as a workaround for the spindown problem.

Acknowledgments

There is a forum, largely in German, for discussions on the NAS-4220. There is an English section however and the creator of this excellent add-on (Skara) describes how to use it. The link is here http://forum.nas-portal.org/showthread.php?t=696&highlight=userscript.

There is also a Wiki describing the script here http://en.nas-4220.org/index.php/Packages:userscript (in English).