diff options
author | ivan <ivan> | 2004-03-24 14:28:48 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-03-24 14:28:48 +0000 |
commit | dabdf357484badff95afcae50b08ec1c3bb58343 (patch) | |
tree | be9286511b919228eda79aa69efacddf449851fb /FS/FS/part_export/www_shellcommands.pm | |
parent | 7de51deb0e3e3fe1b0a9e06be6498256d5511bd0 (diff) |
move export info to the modules themselves
Diffstat (limited to 'FS/FS/part_export/www_shellcommands.pm')
-rw-r--r-- | FS/FS/part_export/www_shellcommands.pm | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index 3e00874..cc1983b 100644 --- a/FS/FS/part_export/www_shellcommands.pm +++ b/FS/FS/part_export/www_shellcommands.pm @@ -1,11 +1,45 @@ package FS::part_export::www_shellcommands; use strict; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; use FS::part_export; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'user' => { label=>'Remote username', default=>'root' }, + 'useradd' => { label=>'Insert command', + default=>'mkdir /var/www/$zone; chown $username /var/www/$zone; ln -s /var/www/$zone $homedir/$zone', + }, + 'userdel' => { label=>'Delete command', + default=>'[ -n "$zone" ] && rm -rf /var/www/$zone; rm $homedir/$zone', + }, + 'usermod' => { label=>'Modify command', + default=>'[ -n "$old_zone" ] && rm $old_homedir/$old_zone; [ "$old_zone" != "$new_zone" -a -n "$new_zone" ] && mv /var/www/$old_zone /var/www/$new_zone; [ "$old_username" != "$new_username" ] && chown -R $new_username /var/www/$new_zone; ln -s /var/www/$new_zone $new_homedir/$new_zone', + }, +; + +%info = ( + 'svc' => 'svc_www', + 'desc' => 'Run remote commands via SSH, for virtual web sites.', + 'options' => \%options, + 'notes' => <<'END' +Run remote commands via SSH, for virtual web sites. You will need to +<a href="../docs/ssh.html">setup SSH for unattended operation</a>. +<BR><BR>The following variables are available for interpolation (prefixed with +<code>new_</code> or <code>old_</code> for replace operations): +<UL> + <LI><code>$zone</code> + <LI><code>$username</code> + <LI><code>$homedir</code> + <LI>All other fields in <a href="../docs/schema.html#svc_www">svc_www</a> + are also available. +</UL> +END +); + + sub rebless { shift; } sub _export_insert { |