forked from crowdsecurity/cs-custom-bouncer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update spec file to handle reload of service
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ rm -rf %{buildroot} | |
%config(noreplace) /etc/crowdsec/bouncers/%{name}.yaml | ||
|
||
|
||
%post | ||
%post -p /bin/bash | ||
systemctl daemon-reload | ||
|
||
|
||
|
@@ -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 |