summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/www_shellcommands.pm
diff options
context:
space:
mode:
authorivan <ivan>2004-03-24 14:28:48 +0000
committerivan <ivan>2004-03-24 14:28:48 +0000
commitdabdf357484badff95afcae50b08ec1c3bb58343 (patch)
treebe9286511b919228eda79aa69efacddf449851fb /FS/FS/part_export/www_shellcommands.pm
parent7de51deb0e3e3fe1b0a9e06be6498256d5511bd0 (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.pm36
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 &quot;$zone&quot; ] && rm -rf /var/www/$zone; rm $homedir/$zone',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'[ -n &quot;$old_zone&quot; ] && rm $old_homedir/$old_zone; [ &quot;$old_zone&quot; != &quot;$new_zone&quot; -a -n &quot;$new_zone&quot; ] && mv /var/www/$old_zone /var/www/$new_zone; [ &quot;$old_username&quot; != &quot;$new_username&quot; ] && 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 {