Syntax to see if two variables match

I have a simple shell script to read create a mysql database as a particular user. Right now, I have the password set as a variable to make sure someone does not mistype the password. I want to take the hard coded password out of the file and make the user input the password twice to make they enter the password correctly. I know I can do the read -s twice and pass the password to two separate variables. I've been unable to find the syntax to see if the variables match and if not, make the user input the password again.

Thanks

easily you can compare the 2 variables using shell builtin tools
syntax #1

if [ "$var1" -eq "var2" ]

syntax #2

if [  "$var1"==  "$var2" ]

syntax #3

if [ "$var1" = "$var2" ]

syntax #4 Comparing two strings.

#!/bin/bash
S1='string'
S2='String'
if [ $S1=$S2 ];
then
echo "S1('$S1') is not equal to S2('$S2')"
fi
if [ $S1=$S1 ];
then
echo "S1('$S1') is equal to S1('$S1')"
fi
            

That's what I needed. Thank you for your assistance. Sorry, for the delay in responding, I was out of town.