From: Dirk Koopman Date: Thu, 21 May 2020 16:30:23 +0000 (+0100) Subject: add missing saveuserfile and expm spawn_cmd cmds X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=250609cfa6bd2cb43122c67ff8fbb8802ccc61f6;p=spider.git add missing saveuserfile and expm spawn_cmd cmds --- diff --git a/cmd/saveuserfile.pl b/cmd/saveuserfile.pl new file mode 100644 index 00000000..845da6ad --- /dev/null +++ b/cmd/saveuserfile.pl @@ -0,0 +1,13 @@ +# +# the export the user file to ascii command +# +# +# +my $self = shift; +return (1, $self->msg('e5')) unless $self->priv >= 9; + +my $count = DXUser::writeoutjson(); # for now + +return (1, "DXUser::writeoutjson - $count lines written"); + + diff --git a/cmd/spawncmd.pl b/cmd/spawncmd.pl new file mode 100644 index 00000000..829c5295 --- /dev/null +++ b/cmd/spawncmd.pl @@ -0,0 +1,13 @@ +# spawn a command +# +# Note: this command will run _nospawn versions of a cmd (as this is a direct lift from +# the 'spawn_cmd' in DXCron pm +# + +sub handle +{ + my ($self, $line) = @_; + return (1, $self->msg('e5')) if $self->priv < 6; + my @out = DXCron::spawn_cmd($line, $self) unless $self->{_nospawn}; + return (1, @out); +}