]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/mocks/fsck
treewide: more portable bash shebangs
[thirdparty/systemd.git] / test / mocks / fsck
CommitLineData
ff12a795 1#!/usr/bin/env bash
89ea179b
DR
2fd=0
3
4OPTIND=1
5while getopts "C:aTlM" opt; do
6 case "$opt" in
7 C)
8 fd=$OPTARG
9 ;;
10 \?);;
11 esac
12done
13
14shift "$((OPTIND-1))"
15device=$1
16
17echo "Running fake fsck on $device"
18
19declare -a maxpass=(30 5 2 30 60)
20
21for 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
27done