Have a basic batch script which updates a postgreSQL table with the users MAC against what is hard coded within the script. When I run it, it thinks both the MAC addresses are different or my syntax it not working. I have tried echo out the variables and they look the same.
Where am I going wrong?
Thanks
@echo off
set mac=00:00:00:00
echo %mac%
set /p mac_address= Please enter the MAC address
echo %mac_address%
if mac==mac_address (
set /p hostname= Please enter the server ip address
echo "update license set lldld" >> run
SET PGPASSWORD=xxxxxxxxxx
postgresql\bin\psql -U postgres -h %hostname% -p 5434 -d jasperserver -a -f run
del run
) else (
Echo "Error with MAC code"
pause
)