Scripts: Difference between revisions

From DXSpider Documentation Wiki
Jump to navigation Jump to search
DXSpider Documentation>G0vgs
Created page with "==Scripts== From 1.48 onwards it will become increasingly possible to control DXSpider's operation with scripts of various kinds. The directory /spider/scripts is where it all happens and is used for several things. Firstly it contains a file called startup that can be used to call in any changes to the cluster from the default settings on startup. This script is executed immediately after all initialisation of the node is done but before any connections are possible..."
 
G0TRT (talk | contribs)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Scripts==
==Scripts==


From 1.48 onwards it will become increasingly possible to control DXSpider's operation with scripts of various kinds.
The directory /spider/scripts is a place for scripts to be placed. The main script in this directory is called startup that can be used to make changes to the cluster from the default settings on startup. This script is executed immediately after all initialisation of the node is done but before any connections are possible. The other two files are startup.issue, which is a minimal file to use to build a startup and user_default.issue


The directory /spider/scripts is where it all happens and is used for several things.  Firstly it contains a file called startup that can be used to call in any changes to the cluster from the default settings on startup.  This script is executed immediately after all initialisation of the node is done but before any connections are possible.  Examples of this include how many spots it is possible to get with the sh/dx command, whether you want registration/passwords to be permanently on etc.  An example file is shown below and is included in the distribution as startup.issue.
===startup===


  #
  #
  # startup script example
  #  
# lines starting with a # are ignored
  #
  #
  # set maximum no of spots allowed to 100
  # set maximum no of spots allowed to 100
  # set/var $Spot::maxspots = 100
  set/var $Spot::maxspots = 100
  #
  #
  # Set registration on
  # reject node adverts
  # set/var $main::reqreg = 1
  rej/ann node_default input info telnet,cluster,7000,7300,7373,8000,8888,9000,17300
  #
  #
  # Set passwords on
  # reject D0 and D1 prefixes which aren't on the ITU list
  # set/var $main::passwdreq = 1
  rej/spot node_default input 2 call d0,d1
rej/spot node_default input 3 by d0,d1
  #
  #
# set outbound spider connections with nodes you've paired with
set/spider g1abc-2
set/spider gb7abc-1
#
# make instant connections to nodes
connect g1abc-2
connect gb7abc-1
#
# make people register before they can send spots
# 1 is on, 0 is off
set/var $main::reqreg = 1
#
# make people use a password to login
# 1 is on, 0 is off
set/var $main::passwdreq = 0
#
# set the node's external dynamic IP
set/external_ip
#
# set the node and logging pc IPv4s
# gather ip address from your network and add them at the end using ,'192.168.1.144' for example
set/var @main::localhost_names ('127.0.0.1', '::1', '192.168.1.123','192.168.1.134')
#
#EOF


As usual, any text behind a # is treated as a comment and not read. To use this file, simply rename it from startup.issue to startup.  In our example above there are three options.  The first option is the amount of spots that a user can request with the sh/dx command.  Normally the default is to give 10 spots unless the user specifies more.  Without this line enabled, the maximum a user can request is 100 spots.  Depending on your link quality you may wish to enable more or less by specifying the number.
===user_default===


The other 2 options are dealt with more fully in the security section.
The user_default.issue file, when copied to user_default or a callsign, is used to deliver initial information to a user. The file below will show the relevant information at login:
 
Secondly, it is used to store the login scripts for users and nodes. Currently this can only be done by the sysop but it is envisaged that eventually users will be able to set their own.  An example is included in the distibution but here is a further example.


  #
  #
  # G0FYD
  # standard user default script
  #
  #
  blank +
  blank +
  sh/wwv 3
  sh/dx 5
  blank +
blank -
  sh/dx
sh/u
  blank +
  blank -
  t g0jhc You abt?
  sh/wwv 1
  blank -
  sh/wcy 1
  blank +
  blank +
#
#EOF


The lines in between commands can simply insert a blank line or a character such as a + sign to make the output easier to read.  Simply create this script with your favourite editor and save it with the callsign of the user as the filename.  Filenames should always be in lower case.


Commands can be inserted in the same way for nodes.  A node may wish a series of commands to be issued on login, such as a merge command for example.


Thirdly, there are 2 default scripts for users and nodes who do not have a specifically defined scriptThese are user_default and node_default
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1814.0 DL3RBF/P    11-Apr-2025 0839Z SOTA activation DM/RP-001    <ON6ZQ>
    7190.0 EA2CCG/P    11-Apr-2025 0839Z POTA ES-0261 ES-0921        <EA7KOY>
  14042.0 F5NLX/P    11-Apr-2025 0839Z FFF 1027 POTA FR-3758 WCA F-07<F5MGS>
  18104.0 RC0AT      11-Apr-2025 0839Z www.TNXQSO.com                <R1NA>
    7048.2 VA3JPX      11-Apr-2025 0838Z                                <KA2G>
-------------------------------------------------------------------------------
Callsigns connected to G0TRT-9
G1ABC      G0TRT        G3XVL      WI3W      G0FOZ
-------------------------------------------------------------------------------
Date        Hour  SFI  A  K Forecast                              Logger
11-Apr-2025  06  153  17  3 No Storms -> No Storms                <W0MU>
-------------------------------------------------------------------------------
Date        Hour  SFI  A  K Exp.K  R SA    GMF  Aurora  Logger
11-Apr-2025  08  153  22  3    3 112 eru  act      no  <DK0WCY>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Nodes: 6/380 Users [Loc/Clr]: 5/4725 Max: 4/4725 - Uptime: 9h 59m 25s

Latest revision as of 08:49, 11 April 2025

Scripts

The directory /spider/scripts is a place for scripts to be placed. The main script in this directory is called startup that can be used to make changes to the cluster from the default settings on startup. This script is executed immediately after all initialisation of the node is done but before any connections are possible. The other two files are startup.issue, which is a minimal file to use to build a startup and user_default.issue

startup

#
# 
# lines starting with a # are ignored
#
# set maximum no of spots allowed to 100
set/var $Spot::maxspots = 100
#
# reject node adverts
rej/ann node_default input info telnet,cluster,7000,7300,7373,8000,8888,9000,17300
#
# reject D0 and D1 prefixes which aren't on the ITU list
rej/spot node_default input 2 call d0,d1
rej/spot node_default input 3 by d0,d1
#
# set outbound spider connections with nodes you've paired with
set/spider g1abc-2
set/spider gb7abc-1
#
# make instant connections to nodes
connect g1abc-2
connect gb7abc-1
#
# make people register before they can send spots
# 1 is on, 0 is off
set/var $main::reqreg = 1
#
# make people use a password to login
# 1 is on, 0 is off
set/var $main::passwdreq = 0
#
# set the node's external dynamic IP
set/external_ip
#
# set the node and logging pc IPv4s
# gather ip address from your network and add them at the end using ,'192.168.1.144' for example
set/var @main::localhost_names ('127.0.0.1', '::1', '192.168.1.123','192.168.1.134')
#
#EOF

user_default

The user_default.issue file, when copied to user_default or a callsign, is used to deliver initial information to a user. The file below will show the relevant information at login:

#
# standard user default script
#
blank +
sh/dx 5
blank -
sh/u
blank -
sh/wwv 1
blank -
sh/wcy 1
blank +
#
#EOF


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   1814.0 DL3RBF/P    11-Apr-2025 0839Z SOTA activation DM/RP-001     <ON6ZQ>
   7190.0 EA2CCG/P    11-Apr-2025 0839Z POTA ES-0261 ES-0921         <EA7KOY>
  14042.0 F5NLX/P     11-Apr-2025 0839Z FFF 1027 POTA FR-3758 WCA F-07<F5MGS>
  18104.0 RC0AT       11-Apr-2025 0839Z www.TNXQSO.com                 <R1NA>
   7048.2 VA3JPX      11-Apr-2025 0838Z                                <KA2G>
-------------------------------------------------------------------------------
Callsigns connected to G0TRT-9
G1ABC       G0TRT        G3XVL      WI3W      G0FOZ
-------------------------------------------------------------------------------
Date        Hour   SFI   A   K Forecast                              Logger
11-Apr-2025   06   153  17   3 No Storms -> No Storms                <W0MU>
-------------------------------------------------------------------------------
Date        Hour   SFI   A   K Exp.K   R SA    GMF   Aurora   Logger
11-Apr-2025   08   153  22   3     3 112 eru   act       no   <DK0WCY>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Nodes: 6/380 Users [Loc/Clr]: 5/4725 Max: 4/4725 - Uptime:  9h 59m 25s