Cross Reference: fsck
xref
: /
systemd
/
test
/
mocks
/
fsck
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
#!/
bin
/
bash
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
fd
=
0
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
OPTIND
=
1
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
while
getopts
"C:aTlM"
opt
;
do
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
case
"
$opt
"
in
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
C)
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
fd
=
$OPTARG
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
;;
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
\?);;
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
esac
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
done
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
shift
"
$(
(
OPTIND
-
1
)
)
"
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
device
=$
1
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
echo
"Running fake fsck on
$device
"
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
declare
-a
maxpass
=
(
30
5
2
30
60
)
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
for
pass
in
{
1
..
5
};
do
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
maxprogress
=${
maxpass
[
$(
(
pass
-
1
)
)
]}
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
for
(
(
current
=
0
;
current
<=${
maxprogress
};
current
++)
)
;
do
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
echo
"
$pass
$current
$maxprogress
$device
"
>&
$fd
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
sleep
0.1
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
done
89ea179b603cecfd1096a673073325f13028c421
Didier Roche
done