Bash - what's the use of "fi ;;"?

I have been searching everywhere for an explanation. Here's a real example taken from the apt-fast.sh script:

if [ ! -x /usr/bin/axel ]
then echo "axel is not installed, perform this?(y/n)"
read ops
case $ops in
y) if apt-get install axel -y --force-yes
then echo "axel installed"
else echo "unable to install the axel. you are using sudo?" ; exit
fi ;;
n) echo "not possible usage apt-fast" ; exit ;;
esac
fi

What's the use of "fi ;;" in the middle of the if block?

117954 次浏览

fi terminates the preceding if, while ;; terminates the y) case in the case...esac.

fi closes the if statement opened 3 lines up. ;; closes the case opened by y).

The fi is to close the if-block in the y) case statement and the ;; is used to end the y) case.

fi closes the if statement, while ;; closes the current entry in the case statement.