1 package FS::part_export::shellcommands;
6 @ISA = qw(FS::part_export);
12 $self->_export_command('useradd', @_);
17 $self->_export_command('userdel', @_);
21 my ( $self, $action, $svc_acct) = (shift, shift, shift);
22 my $command = $self->option($action);
24 ${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields;
25 $self->shellcommands_queue(
26 $self->options('user')||'root'. "\@". $self->options('machine'),
32 my($self, $new, $old ) = (shift, shift, shift);
33 my $command = $self->option('usermod');
35 ${"old_$_"} = $old->getfield($_) foreach $old->fields;
36 ${"new_$_"} = $new->getfield($_) foreach $new->fields;
37 $self->shellcommands_queue(
38 $self->options('user')||'root'. "\@". $self->options('machine'),
43 #a good idea to queue anything that could fail or take any time
44 sub shellcommands_queue {
45 my( $self, $svcnum ) = (shift, shift);
46 my $queue = new FS::queue {
48 'job' => "Net::SSH::ssh_cmd", #freeside-queued pre-uses...
53 #sub shellcommands_insert { #subroutine, not method
55 #sub shellcommands_replace { #subroutine, not method
57 #sub shellcommands_delete { #subroutine, not method