aboutsummaryrefslogtreecommitdiffstats
path: root/tools/dd.sh
blob: f698a364ba50c83d057a358aadc33759168c8fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

if [ $# -ne 2 ]
then
  exit 1
fi

/bin/dd if=$1 of=$2 bs=8M &
pid=$!

echo "DDPID=$pid"

while true;
do
  sleep 5
  kill -USR1 $pid 1>/dev/null 2>&1
  if [ $? -ne 0 ]
  then
    exit 0
  fi
done

sync