![Digi Digi CM 16 User Manual Download Page 150](http://html1.mh-extra.com/html/digi/digi-cm-16/digi-cm-16_user-manual_2496441150.webp)
Command line interface
Example scripts
Digi CM User Guide
150
User storage space
The Digi CM unit comes with 1 megabyte of user storage space. This storage space can be used to
store custom scripts. The location is /usr2. Custom scripts such as simple commands, are simply
dropped into /usr2. If a file needs to be edited, copy the file into usr2/rc.usr, kill the process, then
restart the process from the new file. Scripts from the user storage may be created to run during
boot after the network is up. The following are some examples of various ways to create a script
stored in the user storage space.
▪
Saving IP tables options permanently
▪
Changing radius socket ports
▪
Limiting root access to the console on Digi CM products
▪
Sending a break
Example scripts
Example script: Saving IP tables options permanently
Add the following command in the '/usr2/rc.user' script file just above "exit 0". Disabling Telnet is
just shown as one example.
1
Create a new script file '/usr2/run.user' that includes the commands you want.
iptables -A INPUT -p tcp --dport 23 -j DROP
2
Run the following command to make the script executable
chmod 755 /usr2/run.user
3
Add the following command in the '/usr2/rc.user' script, just above "exit 0"
ln -s /usr2/run.user /etc/rc.d/rc2.d/S60runuser
4
Reboot
reboot
Note
If you factory default the unit, the '/usr2/rc.user' script file is moved to '/usr2/rc.user.old#'
and the default rc.user file will be restored.
Example script: Changing radius socket ports
The radius client obtains the radius socket ports to use via the '/etc/services' file. The client only
looks up the lines starting with 'radius' and 'radacct'.
1
Modify the /etc/services file as follows. Change lines starting with 'radius' and 'radacct' to the
socket numbers you wish. For example:
radius 1645/tcp
radius 1645/ucp
radacct 1646/tcp
radacct 1646/ucp
2
After editing /etc/services copy it to /usr2
cp /etc/services /usr2
3
Edit /usr2/rc.user and add the following line just above "exit 0":
cp -a /usr2/services /etc/services
Summary of Contents for Digi CM 16
Page 1: ...User Guide Digi CM 8 port 16 port 32 port and 48 port...
Page 63: ...Digi CM User Guide 63 User administration Administer users 64...
Page 130: ...Power Controller Cascade multiple Digi RPM units Digi CM User Guide 130...
Page 131: ...Digi CM User Guide 131 Port clustering Introduction 132 Configure port clustering 132...