X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fstartup.pl;fp=cmd%2Fset%2Fstartup.pl;h=0c0c24b969765179a05441e26ec706954b5216ef;hb=fe4f4e3751da3786d25df2fe2fba104523de095d;hp=0000000000000000000000000000000000000000;hpb=168689554677c7f1480d6f1161ee371e12548e6b;p=spider.git diff --git a/cmd/set/startup.pl b/cmd/set/startup.pl new file mode 100644 index 00000000..0c0c24b9 --- /dev/null +++ b/cmd/set/startup.pl @@ -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); +