I am using the below code in my post deploy script :
if [ "$1" -ge 1 ]; then
service code-snip restart
service code-snip start
Open in new window
As per my understanding when yum update rpm_name is done $1 will take value 2 or more.
And when yum install rpm_name is done $1 will take a value 1
When doing yum update this works fine and my service is restarted.
Now i did yum remove rpm_name
And then did yum install rpm_name
I got an error saying the service is already stop. Means that the restart line got executed
Somewhow $1 is coming still >1 even though i removed the package.
what could be the reason for this. How can i correct it ?
also one more thing i want to confirm
as per documentation $1 gives th count of versions of package
so does $1 when doing yum install always return 1 ?
and 0 on doing yum remove, 2 on yum update.
in what cases can the value be greater than 2