Worked great for me but the check for the SWAP partition should be case insensitive.

... |grep -i "Linux swap" (I had 'Linux Swap' with fdisk -l)

Holger