]>
Commit | Line | Data |
---|---|---|
ff12a795 | 1 | #!/usr/bin/env bash |
89ea179b DR |
2 | fd=0 |
3 | ||
4 | OPTIND=1 | |
5 | while getopts "C:aTlM" opt; do | |
6 | case "$opt" in | |
7 | C) | |
8 | fd=$OPTARG | |
9 | ;; | |
10 | \?);; | |
11 | esac | |
12 | done | |
13 | ||
14 | shift "$((OPTIND-1))" | |
15 | device=$1 | |
16 | ||
17 | echo "Running fake fsck on $device" | |
18 | ||
19 | declare -a maxpass=(30 5 2 30 60) | |
20 | ||
21 | for pass in {1..5}; do | |
22 | maxprogress=${maxpass[$((pass-1))]} | |
23 | for (( current=0; current<=${maxprogress}; current++)); do | |
24 | echo "$pass $current $maxprogress $device">&$fd | |
25 | sleep 0.1 | |
26 | done | |
27 | done |