fs_wipe
This commit is contained in:
parent
dfe3be4f1c
commit
3b2df8f8a0
1 changed files with 21 additions and 0 deletions
21
bash/fs.sh
21
bash/fs.sh
|
@ -17,3 +17,24 @@ fs_make_fat() {
|
||||||
mkfs.fat "${@}" "${device}"
|
mkfs.fat "${@}" "${device}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs_wipe() {
|
||||||
|
local device="${1}"
|
||||||
|
local buffer="${2}"
|
||||||
|
local count="${3}"
|
||||||
|
if [ -b "${device}" ]; then
|
||||||
|
set -- \
|
||||||
|
status="progress" \
|
||||||
|
if="/dev/zero" \
|
||||||
|
of="${device}"
|
||||||
|
if [ -n "${buffer}" ]; then
|
||||||
|
set -- "${@}" \
|
||||||
|
bs="${buffer}"
|
||||||
|
fi
|
||||||
|
if [ -n "${count}" ]; then
|
||||||
|
set -- "${@}" \
|
||||||
|
count=${count}
|
||||||
|
fi
|
||||||
|
dd "${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue