Is there any or command to check whether NGINX is already installed on UBUNTU Linux using a bash command/script?
I was trying something like this
echo "BEGINNING INSTALLATION OF NGINX WEB SERVER" echo echo echo "CHECKING TO SEE IF NGINX IS ALREADY INSTALLED" service nginx > temp.install 2> temperr.install echo 111 grep -c unrecognized temperr.install > temp2.install echo 222 status = `cat temp2.install` echo "NGINX STATUS $status"
Am new to bash scripting and hence not sure if this is teh best possible way to approach this. I need to write a script that checks if NGINX is already installed or not. If it is not installed it simply installs NGINX otherwise it first deletes NGINX and then re-installs it.