RouterTech Firmware: extra command line tools (Firmware v)
All these commands are in /usr/local/bin/
- autoexec.sh - runs whatever is passed to it; useful for running things when the router reboots
- bwbasic - the bwbasic interpreter (replaces tcl in the wireless routers)
- checksync.sh - enables sync monitoring in crontab
- chksync - 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)
- cronjob.sh - acts as a
shell to set up cron jobs more easily, and makes the cron job
persistent by making an entry into the bootloader environment
- cronjob-env.sh - acts as a shell to set up cron jobs more easily
- cron_la.sh - enables the monitoring of line attenuation in crontab
- darkstat - captures network traffic, calculates statistics about usage, and serves reports over HTTP.
- 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)
- 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)
- ftpmount
- allows you to mount directories from an ftp server (after loading the
ftpfs driver). Run the command with no parameter for the syntax.
- 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
- localnat.sh - enables local NAT loopback - experimental
- 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
- netshaper - allows you to limit the bandwidth by IP addresses/ranges (you need to run "setenv netshaper_enable 1" and reboot before you can use it)
- onconnectWAN - this is executed (after being copied to /var/tmp/) by the ip-up script when a WAN connection is achieved; by default it runs crond and darkstat (if they are enabled).
- pppHB.sh - half-bridge script - experimental
- 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)
- tinytrans.sh - shell for tinyproxy that sets up tinyproxy for transparent mode and then runs tinyproxy
- unsetenv - delete a variable from the bootloader environment
- usb_disable.sh - sets the router to NOT start USB automatically (writes to the bootloader environment)
- usb_enable.sh - returns to the default (to start USB automatically) (writes to the bootloader environment)
- usb_start.sh - starts USB
- usb_stop.sh - stops USB
- wakelan - wakes up PCs on the LAN (run "wakelan --help" for further information)
- wan_uptime - shows how long the router has been connected to the outside world for
See other commands below.
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.
6. RT_init_<n>
Here, "n" stands for a number (e.g., "RT_init_1"). This feature allows
you to specify certain commands to be executed automatically when the
router boots up, at a very early stage of the bootup process.
e.g.,
setenv RT_init_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.
or
setenv RT_init_1 "netshaper -s 192.168.1.3 524288"
This will set up the router to run the netshaper 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
- Led (to manipulate the router's leds)
- printf
- sort
- 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))
others (all over the place)- 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
And a whole host of others ...