#!/bin/sh

# Copyright (C) 2009 Draytek

dev_num=$(grep -c Lev=02.*Port=01 /proc/bus/usb/devices)
if [ $dev_num = "1" ]; then
        # USB1 on
        echo on > /proc/gpio/LED2
else
        echo off > /proc/gpio/LED2
fi

dev_num=$(grep -c Lev=02.*Port=02 /proc/bus/usb/devices)
if [ $dev_num = "1" ]; then
        # USB2 on
        echo on > /proc/gpio/LED3
else
        echo off > /proc/gpio/LED3
fi
