Skip to content

Commit

Permalink
update spec file to handle reload of service
Browse files Browse the repository at this point in the history
  • Loading branch information
buixor committed Jul 5, 2021
1 parent 1855bcb commit 15856e1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions rpm/SPECS/crowdsec-custom-bouncer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rm -rf %{buildroot}
%config(noreplace) /etc/crowdsec/bouncers/%{name}.yaml


%post
%post -p /bin/bash
systemctl daemon-reload


Expand Down Expand Up @@ -89,6 +89,20 @@ echo "please enter the binary path in '/etc/crowdsec/bouncers/crowdsec-custom-bo
* Wed Jun 30 2021 Shivam Sandbhor <[email protected]>
- First initial packaging

%preun
systemctl stop crowdsec-custom-bouncer || echo "cannot stop service"
systemctl disable crowdsec-custom-bouncer || echo "cannot disable service"
%preun -p /bin/bash

if [ "$1" == "0" ] ; then
systemctl stop crowdsec-custom-bouncer || echo "cannot stop service"
systemctl disable crowdsec-custom-bouncer || echo "cannot disable service"
fi



%postun -p /bin/bash

if [ "$1" == "1" ] ; then
systemctl restart crowdsec-custom-bouncer || echo "cannot restart service"
elif [ "$1" == "0" ] ; then
systemctl stop crowdsec-custom-bouncer
systemctl disable crowdsec-custom-bouncer
fi

0 comments on commit 15856e1

Please sign in to comment.