I have the following script in my spec file %preun tag:
if [ $1 -eq 0 ]; then
echo "Stopping blah service before uninstalling.."
. /etc/init.d/blahforever stop
echo "blah service stopped."
fi
I get "syntax error near unexpected token `fi'" error
but when I add else block it runs fine:
if [ $1 -eq 0 ]; then
echo "Stopping blah service before uninstalling.."
. /etc/init.d/blahforever stop
echo "blah service stopped."
else
echo "I dont need else block"
fi
But I don't need an else block! How do I get rid of it? PS: I tried removing the semi colon after the condition and still didn't help.