X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fwww_shellcommands.pm;h=cc1983bf2c7fd66294ded7c3842102e18565e3a8;hp=3e00874469d5cf0705e4d524a1c552289eb580c5;hb=dabdf357484badff95afcae50b08ec1c3bb58343;hpb=7de51deb0e3e3fe1b0a9e06be6498256d5511bd0 diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index 3e0087446..cc1983bf2 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 +setup SSH for unattended operation. +

The following variables are available for interpolation (prefixed with +new_ or old_ for replace operations): + +END +); + + sub rebless { shift; } sub _export_insert {