RouterTech Firmware: extra command line tools (Firmware v2.3)
All these commands are in /usr/local/bin/
- autoexec.sh - runs whatever is passed to it; useful for running things when the router reboots
- checksync.sh - enables sync monitoring in crontab
- chksync.sh - checks whether there is a WAN connection, and, if not, reboots the router
- cron_disable.sh - sets the router to NOT start "crond" automatically (writes to the bootloader environment)
- cron_enable.sh - returns to the default (to start "crond" automatically) (writes to the bootloader environment)
- cron_la.sh - enables the monitoring of line attenuation in crontab
- deletemtd.sh - delete the mtd5 partition and restore the mtd partition table to
the values before a new mtd partition was created (wireless routers
only)
- diagnostics.sh - shows router diagnostic information
- edit - easy to use editor (wireless routers only)
- ether-wake (similar to wakelan)
- ettclsh - tcl interpreter (wireless routers only) - run "/usr/bin/tcl" which is symlinked to ettclsh
- filecomp.sh - compare the sizes of two files
- filesize.sh - report the size of a file
- ftp - ftp client for getting files to/from the router's /var directory (wireless routers only)
- getenv - shows the environment variables (in the bootloader environment - "/proc/ticfg/env" for the PSP boot loader, or
"/proc/sys/dev/adam2/environment" for the Adam2 boot loader)
- listconnections.sh - lists the current connections
- makemtd.sh - create a new mtd partition automatically (wireless routers only). Run the command with no parameters to get the syntax.
- memchk.sh - enables memory monitoring and optimisation in crontab
- memopt.sh - runs the memory optimiser
- msmtp - SSMTP - to send emails from the router (run "msmtp --help" for further information)
- msmtp.sh - runs msmtp with parameters given to it
- printenv - same as getenv
- rshaperctl - allows you to limit the bandwidth by IP addresses/ranges (you need to run "setenv rshaper_enable 1" and reboot before you can use it)
- saveall.sh - saves all config changes
- save-reboot.sh - saves all config changes and reboots
- setenv - sets an environment variable (in the bootloader environment) - run "setenv -h" for further information)
- sft_start.sh - starts the "small FTP server" (sft) to receive files on port 5556
- showdns.sh - shows the ISP's DNS information
- showip.sh - shows your WAN IP (pppoa connections only)
- show_la.sh - sends line attenuation information to the system log
- showlog.sh - shows the contents of the system log
- show_nat_settings.sh - shows the current NAT settings
- tinyproxy - web proxy and URL filter (the URLs to be blocked must be put in /var/tmp/tinyproxy.filter, before starting tinyproxy)
- unsetenv - delete a variable from the bootloader environment
- wakelan - wakes up PCs on the LAN (run "wakelan --help" for further information)
See other commands below.
DSP & ATM:
# Facility to choose between different DSP/ATM modem driver versions
e.g., running: setenv dsp_ver dsp72A && setenv atm_ver dsp72A && reboot.sh
would select DSP and ATM v7.2, AnnexA.
# Instead if you want use dsp7.2A and atm6.2A (for example)
e.g., running: setenv dsp_ver dsp72A && setenv atm_ver dsp62A && reboot.sh
# For use with annexB line (6.2 annexB)
Running: setenv dsp_ver dsp62B && setenv atm_ver dsp62B && reboot.sh
# For restore default value (6.2 annexA) you can use environment variables, "erase"
Running: setenv dsp_ver erase && setenv atm_ver erase && reboot.sh
Choices are between dsp&atm 6.2A, 7.2A, and 6.2B.
# (i.e., DSP v6.2, AnnexB - note that the AnnexB selection is untested).
Note also that all these are case-sensitive. The default is dsp62A.
rshaperctl:
#New feature (rshaper.o loaded) and command: rshaperctl
e.g., rshaperctl 192.168.1.6 65536
(Limits the incoming bandwidth for the host to 65536 bytes per second=64Kbps)
NB: "64x1024=65536" - More info > RSHAPER - shape incoming traffic.
#Facility for executing commands on bootup - by "RT_cmd_x" entries in the environment ("x") stands for a number
or some other distinguishing letter/number: e.g.,
setenv RT_cmd_1 "rshaperctl 192.168.1.6 65536" (will execute "rshaperctl 192.168.1.6 32768" during bootup)
NOTES:
Of the above shell scripts, the following can be executed on bootup by
making entries for them in the bootloader environment ("/proc/ticfg/env" for the PSP boot loader, or
"/proc/sys/dev/adam2/environment" for the Adam2 boot loader).
Examples:
1. autoexec.sh
e.g.,
setenv autoexec.sh "cd /var && wget http://fpp.com/bar.sh && chmod a+x ./bar.sh && ./bar.sh"
This will set up the router to fetch a script (bar.sh) from a website,
set its executable flag, and then run it, everytime the router boots up.
2. checksync.sh
e.g.,
setenv checksync.sh "1"
This will set up the router to monitor the router sync status every hour
setenv checksync.sh "1 30"
This will set up the router to monitor the router sync status every 30 minutes of every hour
3. cron_la.sh
e.g.,
setenv cron_la.sh "2"
This will set up the router to log the line attenuation figures every 2 hours
4. memchk.sh
e.g.,
setenv memchk.sh "1"
This will set up the router to run the memory optimiser every hour
setenv memchk.sh "1 15"
This will set up the router to run the memory optimiser every 15 minutes of every hour
5. msmtp.sh
e.g.,
setenv msmtp.sh "[email protected] --host=post.foo.com [email protected] < /var/msg.txt"
This will set up the router to email the contents of the file "msg.txt" to "[email protected]", using the smtp server "post.foo.com" (with sender as "[email protected]") everytime the router boots up.
6. RT_cmd_<n>
Here, "n" stands for a number (e.g., "RT_cmd_1"). This feature allows
you to specify certain commands to be executed automatically when the
router boots up.
e.g.,
setenv RT_cmd_1 "rshaperctl 192.168.1.3 524288"
This will set up the router to run the rshaperctl commmand on
bootup, to throttle the bandwidth of the computer at 192.168.1.3 to no
more than 512kbps.
Other RouterTech Firmware Commands
/bin/
- chgrp
- chmod
- chown
- df
- egrep
- grep
- hostname
- kill
- mkdir
- more
- mount
- netstat
- pidof
- rmdir
- sed
- touch
- true
- uname
/usr/bin/
- basename
- clear
- cm_cli_ex (a version of cm_cli that allows redirection of its output)
- cmp
- dirname
- du (wireless routers only)
- expr
- find
- free
- head
- id
- killall
- printf
- tcl (tcl interpreter (wireless routers only))
- telnet (wireless routers only)
- test
- tftp
- traceroute (wireless routers only)
- which (wireless routers only)
/sbin/
- fsck.minix (check a minix filesystem (wireless routers only))
- mkfs.minix (creates a minix filesystem (wireless routers only))
usr/local/bin/
- bunzip2
- bzcat
- cpio
- crond
- crontab
- ftpget
- ftpput
- gunzip
- gzip
- klogd (kernel log daemon - allows you to log kernel messages)
- logger (allows you to write a message to the system log)
- logread (allows you to read system and kernel logs when directed to the
circular buffer, rather than to a file)
- sft (small ftp server)
- syslogd (syslog daemon - allows you to have customised system logs)
- tar
- top (displays currently running processes and important information about
them)
- uncompress
- unzip
- zcat