Chapter 7. Custom Commands

Table of Contents
7.1. Adding SITE commands
7.2. Connecting events to commands

7.1. Adding SITE commands

You can add SITE commands to the server, by defining a new command, calling an external program when used. They will be used exactly as other SITE commands.

If the command needs arguments you just have to specify them after the command. You can use cookies in the arguments, they will be replaced as usual.

site_cmd = rescan /path/to/rescan.sh %username

If user gives some arguments to command they will be passed to the program. If you add some arguments after the command path they will always be passed to the program, followed by arguments given by user if needed.

Exemple: with the previous definition of the 'rescan' command, the command

site rescan /dir
run by user 'foo' will make the server run the following command:
/path/to/rescan.sh foo /dir

If the command name contains spaces, quote it ("/path/to my/command")

NOTE: remember that SITE commands are not allowed by default, so you must add a permission line in your config file, or your command will not be accessible.