All pastes #251199 Raw Edit

Mine

public text v1 · immutable
#251199 ·published 2006-11-17 21:38 UTC
rendered paste body
###########################################################
# identification of the device
#
device_name=$(nvram get device_name)

[ -z "$device_name" ] && [ -f "/proc/diag/model" ] && device_name=$(cat "/proc/diag/model")
while [ -z "$device_name" ]; do  
        dd bs=1024 skip=212 count=16 if=/dev/mtd/0 2>/dev/null | strings | grep -q W54G
        [ $? = "0" ] && {
               device_name="Linksys WRT54G"
               break
        }
        dd bs=1024 count=1 skip=5 if=/dev/mtd/0 2>/dev/null | strings | grep "WL500gp"
        [ $? = "0" ] && {
               device_name="ASUS WL-500gp"       
               break
        }
        nvram get hardware_version | grep -q WL500gd
        [ $? = "0" ] && {
               device_name="ASUS WL-500gd"
        	 break
        }
break
done
nvram set "device_name=$device_name"
# do not commit changes:
# our id code is fast, we'll do it every boot until user does a commit for some other reason.
echo "Device: $device_name"