OpenWRT on Asus WL-500gP: Command and Path Reference
Contents
console commands
COMMAND | DESCRIPTION |
ipkg | package manager (update list status install) |
logread | display entries from log files |
nvram show | display nvram values |
nvram set wl0_radio=0; wifi | turn radio off |
nvram set wl0_radio=1; wifi | turn radio on |
logread | view system log, all logs |
perform basic tasks by command path reference
restart network
/etc/init.d/S40network restart
search for files or folders
find / -name $1 -print
view dhcp leases
cat /tmp/dhcp.leases
system logs
syslogd is started on startup. You can read it with 'logread'.
logread logread -f
There are two options for where to send the logging output: (1) to a local file stored in RAM, (2) to a remote system. The local file option is very easy but because it is stored in RAM it will go away whenever the router reboots.
Enable remote logging:
nvram set log_ipaddr=<your syslogd ip> nvram commit
To run syslogd and klogd
vi /etc/inittab
add the following lines:
::respawn:/sbin/syslogd -n ::respawn:/sbin/klogd -n
Tells syslogd to write the log file to /var/log/messages
/var is linked to /tmp but we may need to create /var/log at boot time
vi /etc/init.d/rcS
add the following line:
mkdir /var/log
which computers are connected and at what signal strength
Response is in dBm's and a less negative number is better. Put this script in /bin
ipkg install wl
#!/bin/sh for MAC in `wl assoclist | awk '{print $2}'` do echo -n "Computer: `grep -i ${MAC} /var/dhcp.leases | awk '{print $4}'`"; echo -n " IP: `grep -i ${MAC} /var/dhcp.leases | awk '{print $3}'`"; echo -n " Expires: `grep -i ${MAC} /var/dhcp.leases | awk '{print $1}' | awk '{print strftime("%x %X",$1)}'`" ; echo -n " Signal Strength: `wl rssi $MAC | awk '{print $3}'` dBm" ; echo " " done
path information
The example configuration includes a mounted flash drive on the USB port. The bootloader then is configured so that the flash drive is mounted and the operating system loaded from it.
busybox shell command path information:
/mnt/disc0_1/usr/bin/ /usr/bin/