SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

DUD: (Dial-Up Downloader)

DUD is a collection of scripts for managing downloads over a dial-up connection. The scripts are meant to be started by the ip-up.local script, and notify the user who initiated the download on its completion.

When integrated with PPP, DUD will automatically resume incomplete downloads whenever a PPP connection is established.

The latest version of DUD (v2.x) is a complete rewrite and shares nothing in common with older versions. In fact, it should happily co-exist with older version of DUD.

DUD is now a simple template engine, which generates customized scripts for each download. The scripts themselves can be written in shell, perl, python, etc.

Whenever a download is initiated, DUD tries to match the URL to one of the patterns specified in the config file. If the URL matches one of the patterns, the corresponding template is used to create a custom download script for this download. This script is spooled for execution whenever requested, like for example, when the PPP connection is initiated.

DUD is meant to be installed as root and supports multi-user operation. By default, all users are allowed to schedule downloads. Each download script runs as the user who initiated the download. Any restriction on the users who should be allowed to schedule downloads can be handled using the regular UNIX permission sets.

Any user who is allowed to create files in the spool directory is assumed to have permission to schedule downloads. The write permission to this directory can be restricted to a certain group. Only users belonging to this group will then be allowed to schedule downloads.

PRE-REQUISITES:

  • Perl 5 Most UNIX/Linux systems come pre-installed with Perl. DUD does not require any packages which are not part of the standard Perl installation.
  • Wget The default download templates use 'wget' for downloads. Like all GNU utilities, the latest version of Wget can be found at the master GNU archive site and its mirrors. ftp://ftp.gnu.org/gnu/wget/
  • Axel (optional) Axel is a lightweight download accelerator for UNIX. It tries to accelerate HTTP/FTP downloads using multiple connections, possibly to multiple servers. You can find axel links and info at: http://www.lintux.cx/axel.html

INSTALLATION/USAGE:

  1. Extract the contents to a directory

$ cd /tmp
$ tar zxvf dud-2.0.tgz

2. Run the `install' script as root

$ su -c ./install

Password

The install script prompts you for the installation directory, the config file location, the log file location, the Perl binary to use, the download script spool directory as well as the script template directory.

3. Customize the system-wide config file

Customize the 'Template Choosers' section in the main config file (Default: /usr/local/etc/dudrc) if necessary. The defaults should be good enough to start out with.

4. Start firing downloads

$ dud --help
$ dud <url>

5. Start the actual downloads

DUD by default spools all download requests. The actual startup of the downloads is the responsibility of the `dudctl' script. This can be invoked by a regular user to start/resume his downloads. When run as root, it starts/resumes every user's downloads, running each download script as the user who spooled the download.

4. Integrate with PPP

DUD is meant to run unattended, starting up and resuming downloads whenever the dialup link comes up and terminating the downloads when the link goes down. For this to work, a couple of lines need to be added to the ip-up.local and ip-down.local scripts.

Add the following line to ip-up.local (usually located in the /etc/ppp directory):

/usr/local/bin/dudctl &

[ Replace `/usr/local/bin' with the actual DUD installation

      directory.  For instance, in case of an RPM install, the
      installation directory would be `/usr/bin' ]

Add the following line to ip-down.local:

killall -USR1 dudctl

WRITING CUSTOM TEMPLATES:

DUD2 is designed to be very extensible. Custom templates can be written to handle any kind of downloads. In fact, the jobs do not need to be downloads. Templates can be written for any kind of scripts which need to be run when the dialup link comes up. You could, for example, write a template to fetch your favourite comics from the web, invoke it from the cron every morning and have it execute at whatever time you dialin to your ISP.

For help writing custom template, have a look at the sample template -- templates/sample.tmpl. The http.tmpl and axel.tmpl templates also illustrate some typical approaches.

PROBLEM REPORTING:

If you encounter any bugs or have any questions or comments, send an email to the following address:
email: dud-bugs@dud-uh.com


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.