-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_binary.sh
More file actions
executable file
·47 lines (42 loc) · 1.16 KB
/
gen_binary.sh
File metadata and controls
executable file
·47 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
if [[ $2 ]]; then
CWD=$2
else
CWD=`pwd`
fi
if [[ $1 == "--quiet" ]]; then
dd bs=1024 count=1024 if=/dev/urandom of=$CWD/files/1MB.bin 2>/dev/null && \
dd bs=1024 count=102400 if=/dev/urandom of=$CWD/files/100MB.bin 2>/dev/null && \
dd bs=1024 count=1048576 if=/dev/urandom of=$CWD/files/1GB.bin 2>/dev/null && \
exit 0
fi
echo "
Will generate
$CWD/files/1MB.bin
$CWD/files/100MB.bin
$CWD/files/1GB.bin
Continue y or n? [n]"
read IN
if [[ "$IN" = "" ]]; then
IN='n'
fi
case $IN in
'n')
echo "Quitting..."
;;
'y')
echo "Generating files..." && \
dd bs=1024 count=1024 if=/dev/urandom of=$CWD/files/1MB.bin && \
echo "Done $CWD/files/1MB.bin " && \
dd bs=1024 count=102400 if=/dev/urandom of=$CWD/files/100MB.bin && \
echo "Done $CWD/files/100MB.bin " && \
dd bs=1024 count=1048576 if=/dev/urandom of=$CWD/files/1GB.bin && \
echo "Done $CWD/files/1GB.bin\n\nComplete."
;;
*)
echo "
This script generates the .bin files for Speed.
Please answer 'y' if you would like the files generated.
"
;;
esac