Configuring Telnet in this manner bypasses a UNIX log in, providing a direct login to a D3 PIB.
For this example the directory name is d3net. It is placed in the /usr/bin directory. The full path is /usr/bin/d3net.
Set the permissions to read and execute (rx) for all users.
This example creates the directory named d3net in the /usr/bin directory, and changes the permissions to read and execute for all users.
mkdir /usr/bin/d3net chmod a+rx /usr/bin/d3net
This example uses PIBs 1 through 20. The port range is 16001 to 16020.
The script executes d3 passing the result of the subtraction as the only argument on the command line. The following sample script does this.
For this example, assume the script name is netcon and the directory name is /usr/bin/d3net, the full path is /usr/bin/d3net/netcon. Enter:
#!/bin/bash PIB=$(basename $0) PIB=$(($PIB – 16000)) exec /usr/bin/d3 $PIB
chmod a+rx /usr/bin/d3net/netcon
Remember, in our example the script name is netcon, and the port range is 16001 to 16020.
ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16001 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16002 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16003 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16018 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16019 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16020
When all the links are created, a long listing (ls –l) of the directory looks like:
total 50 lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16001 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16002 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16003 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16018 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16019 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 rootroot 6 Jan 14 18:47 16020 -> /usr/bin/d3net/netcon -rwxr-xr-x 1 rootroot 72Aug 7 14:03 netcon
For Example:
service d316001 { type = UNLISTED socket_type = stream protocol =tcp wait = yes server = /usr/sbin/in.telnetd server_args = -L /usr/bin/d3net/16001 port = 16001 }
In the example above, note that the:
Name of this file is d316001 (d3+ port number). The name of each file in your range of ports will be d3 + the next port number in the sequence of numbers chosen for your range of ports. For instance, the next file name for this example will be d316002.
service d316001 line of our example uses the same name as the file name.
server_args line must end with the same number used in the file name and the service d316001 line.
port line of our example must reflect the same number as the service d3 , and the server_args lines; note that in our example the port number is also 16001 .
After all of the files in your range of ports have been created, issue this command to restart the deamon.
/etc/rc.d/init.d/xinetd restart