Seems like a `if grep -q state=tmpfs /proc/cmdline` or `if [[ $(</proc/cmdline) =~ state=tmpfs ]]` would be simpler than read and a switch statement.