#!/bin/sh RUN="/mnt/udisk/upgrade/run.sh" dev_name=`echo $1 | cut -c1-3` #flag_file="/sys/block/$dev_name/removable" #echo "flag file = $flag_file" >> /tmp/log #exit #1.get the removable flag; 0---hdd; 1---udisk #echo "args: $#, 1: $1, 2: $2, 3: $3, $4" > /tmp/log #2.detect the usb dev is udisk or hdd /bin/mount -t vfat /dev/$1 /mnt/udisk #touch /tmp/.usb.tmp echo $dev_name > /tmp/.usb.tmp if [ -f $RUN ] then /bin/sh $RUN & fi sync