put dx.pl into an explicit handle sub
[spider.git] / cmd / save.pl
index 9bb74dddc914ce585c2826483e63e0cec4621545..dce7b49cd5bb75b2662d215a3f1dfcb3216c6d16 100644 (file)
@@ -1,13 +1,15 @@
 # 
 # save the output of ANY command to a file
 #
+# From an idea by Rene OZ1LQH
+#
 # Copyright (c) 2002 Dirk Koopman G1TLH
 #
-# $Id$
+#
 #
 
 my ($self, $line) = @_;
-return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd;
+return (1, $self->msg('e5')) if $self->priv < 9 || $self->remotecmd || $self->inscript;
 
 my ($date_req, $time_req);
 my $app_req = '>';
@@ -24,7 +26,7 @@ if ($line =~ /-a/) {                  # append to the file
        $app_req = '>>';
 }
 
-$DB::single = 1;
+#$DB::single = 1;
 
 my ($fn, $rest) = split /\s+/, $line, 2;
 $fn = "$main::root/packclus/$fn" unless $fn =~ m|^/|;
@@ -42,7 +44,9 @@ if ($rest =~ /^\s*\"/) {
 }
 open OF, "$app_req$fn" or return (1, $self->msg('e30', $fn));
 for (@cmd) {
+       $self->{_nospawn} = 1;
        print OF map {"$_\n"} $self->run_cmd($_);
+       delete $self->{_nospawn};
 }
 close OF;
 return (1, $self->msg('ok'));