X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fforward_shellcommands.pm;h=fd1b7efc29679187d391b2b1a64e79eef3fe6f0e;hb=289e35fa98f95021ccda7830146c6c9742302f70;hp=5d3145715bc38f978e169ef2167b3348b8510cbb;hpb=193118008312797e8188145138c6875ba506ff33;p=freeside.git diff --git a/FS/FS/part_export/forward_shellcommands.pm b/FS/FS/part_export/forward_shellcommands.pm index 5d3145715..fd1b7efc2 100644 --- a/FS/FS/part_export/forward_shellcommands.pm +++ b/FS/FS/part_export/forward_shellcommands.pm @@ -1,11 +1,58 @@ package FS::part_export::forward_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=>'', + }, + 'userdel' => { label=>'Delete command', + default=>'', + }, + 'usermod' => { label=>'Modify command', + default=>'', + }, +; + +%info = ( + 'svc' => 'svc_forward', + 'desc' => 'Run remote commands via SSH, for forwards', + 'options' => \%options, + 'notes' => <<'END' +Run remote commands via SSH, for forwards. You will need to +setup SSH for unattended operation. +

Use these buttons for some useful presets: + +The following variables are available for interpolation (prefixed with +new_ or old_ for replace operations): + +END +); + sub rebless { shift; } sub _export_insert { @@ -21,6 +68,7 @@ sub _export_delete { sub _export_command { my ( $self, $action, $svc_forward ) = (shift, shift, shift); my $command = $self->option($action); + return '' if $command =~ /^\s*$/; #set variable for the command no strict 'vars'; @@ -108,3 +156,5 @@ sub ssh_cmd { #subroutine, not method #sub shellcommands_delete { #subroutine, not method #} +1; +