add user startup script maintenance
[spider.git] / cmd / set / startup.pl
diff --git a/cmd/set/startup.pl b/cmd/set/startup.pl
new file mode 100644 (file)
index 0000000..0c0c24b
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# create or replace a startup script
+#
+# Copyright (c) 2005 Dirk Koopman G1TLH
+#
+# $Id$
+#
+my ($self, $line) = @_;
+return (1, $self->msg('e5')) if $self->remotecmd;
+return (1, $self->msg('e5')) if $line && $self->priv < 6;
+return (1, $self->msg('e36')) unless $self->state =~ /^prompt/;
+
+my @out;
+my $loc = $self->{loc} = { call => ($line || $self->call),
+                                                  endaction => "store_startup_script",
+                                                  lines => [],
+                                                };
+# find me and set the state and the function on my state variable to
+# keep calling me for every line until I relinquish control
+$self->func("do_entry_stuff");
+$self->state('enterbody');
+push @out, $self->msg('m8');
+return (1, @out);
+