add missing saveuserfile and expm spawn_cmd cmds
authorDirk Koopman <djk@tobit.co.uk>
Thu, 21 May 2020 16:30:23 +0000 (17:30 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 21 May 2020 16:30:23 +0000 (17:30 +0100)
cmd/saveuserfile.pl [new file with mode: 0644]
cmd/spawncmd.pl [new file with mode: 0644]

diff --git a/cmd/saveuserfile.pl b/cmd/saveuserfile.pl
new file mode 100644 (file)
index 0000000..845da6a
--- /dev/null
@@ -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 (file)
index 0000000..829c529
--- /dev/null
@@ -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);
+}