1#!/bin/sh 2find /tmp/mnt/ -name .wndr3700_disk_share_info -exec rm -f {} \; 3echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4path1=`df | grep ^/dev/sda | sed -n '1p' | awk {' print$6 '}` 5cat $path1/.wndr3700_disk_share_info 6echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 8drive_num=`df | sed -n '$p' | awk {'print$1'} | cut -b 8-8` 9case $drive_num in 10a) drive_num=1 11;; 12b) drive_num=2 13;; 14c) drive_num=3 15;; 16d) drive_num=4 17;; 18e) drive_num=5 19;; 20*) drive_num=6 21;; 22esac 23echo drive_num is $drive_num 24parti_num1=$(df | grep ^/dev/sda | wc -l) 25parti_num2=$(df | grep ^/dev/sdb | wc -l) 26parti_num3=$(df | grep ^/dev/sdc | wc -l) 27parti_num4=$(df | grep ^/dev/sdd | wc -l) 28parti_num5=$(df | grep ^/dev/sde | wc -l) 29parti_num6=$(df | grep ^/dev/sdf | wc -l) 30/bin/config show |grep ^disk_sharefolder | while read oneline; 31do 32 echo $oneline>/tmp/tmp111.a 33 partition_code=`awk '{print$2}' /tmp/tmp111.a` 34 count=0; 35 while [ $partition_code -gt 0 ] 36 do 37 let count++ 38 tmp=parti_num${count} 39 let partition_code=partition_code-tmp 40 done 41 echo partition drive is $count 42 case $count in 43 1) ch=a 44 ;; 45 2) ch=b 46 ;; 47 3) ch=c 48 ;; 49 4) ch=d 50 ;; 51 5) ch=e 52 ;; 53 *) ch=f 54 ;; 55 esac 56 path=`df | grep ^/dev/sd${ch} | sed -n '1p' | awk {' print$6 '}` 57 echo path is $path 58 echo $oneline>>$path/.wndr3700_disk_share_info 59done 60 rm -f /tmp/tmp111.a 61