avoid usage of done as variable name

This commit is contained in:
frennkie 2020-05-24 15:37:54 +01:00
parent 590f5e8b43
commit 6f095a6e80

View file

@ -373,14 +373,14 @@ if [ "$1" = "format" ] && [ "$2" = "ext4" ]; then
sleep 6 sleep 6
sync sync
# loop until the partion gets available # loop until the partion gets available
done=0 loopdone=0
loopcount=0 loopcount=0
while [ ${done} -eq 0 ] while [ ${loopdone} -eq 0 ]
do do
>&2 echo "# waiting until the partion gets available" >&2 echo "# waiting until the partion gets available"
sleep 2 sleep 2
sync sync
done=$(lsblk -o NAME | grep -c ${hdd}1) loopdone=$(lsblk -o NAME | grep -c ${hdd}1)
loopcount=$(($loopcount +1)) loopcount=$(($loopcount +1))
if [ ${loopcount} -gt 10 ]; then if [ ${loopcount} -gt 10 ]; then
echo "error='partition failed'" echo "error='partition failed'"
@ -398,14 +398,14 @@ if [ "$1" = "format" ] && [ "$2" = "ext4" ]; then
>&2 echo "# Formatting" >&2 echo "# Formatting"
sudo mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd}1 1>/dev/null sudo mkfs.ext4 -F -L BLOCKCHAIN /dev/${hdd}1 1>/dev/null
done=0 loopdone=0
loopcount=0 loopcount=0
while [ ${done} -eq 0 ] while [ ${loopdone} -eq 0 ]
do do
>&2 echo "# waiting until formatted drives gets available" >&2 echo "# waiting until formatted drives gets available"
sleep 2 sleep 2
sync sync
done=$(lsblk -o NAME,LABEL | grep -c BLOCKCHAIN) loopdone=$(lsblk -o NAME,LABEL | grep -c BLOCKCHAIN)
loopcount=$(($loopcount +1)) loopcount=$(($loopcount +1))
if [ ${loopcount} -gt 10 ]; then if [ ${loopcount} -gt 10 ]; then
echo "error='formatting ext4 failed'" echo "error='formatting ext4 failed'"