Skip to content

Commit 0043939

Browse files
authored
add a fix for crowdsec firewall bouncer issue 399 (#408)
* add a fix for crowdsec firewall bouncer
1 parent 910a36b commit 0043939

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

rpm/SPECS/crowdsec-firewall-bouncer.spec

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ rm -rf %{buildroot}
3434
mkdir -p %{buildroot}%{_bindir}
3535
install -m 755 %{name} %{buildroot}%{_bindir}/%{name}
3636
# symlink for compatibility with old versions
37-
mkdir -p %{buildroot}/usr/sbin
38-
ln -s %{_bindir}/%{name} %{buildroot}/usr/sbin/%{name}
3937

4038
mkdir -p %{buildroot}/etc/crowdsec/bouncers
4139
install -m 600 config/%{name}.yaml %{buildroot}/etc/crowdsec/bouncers/%{name}.yaml
@@ -91,6 +89,13 @@ fi
9189

9290
set_local_port
9391

92+
if [ ! -e /usr/sbin/crowdsec-firewall-bouncer ]; then
93+
if [ ! -L /usr/sbin ]; then
94+
ln -s ../bin/crowdsec-firewall-bouncer /usr/sbin/crowdsec-firewall-bouncer
95+
fi
96+
fi
97+
98+
9499
%systemd_post %{name}.service
95100

96101
if [ "$START" -eq 0 ]; then
@@ -118,6 +123,11 @@ if [ "$1" = "1" ]; then
118123
systemctl restart %{name} || echo "cannot restart service"
119124
fi
120125

126+
if [ -L /usr/sbin/crowdsec-firewall-bouncer ]; then
127+
rm -f /usr/sbin/crowdsec-firewall-bouncer
128+
fi
129+
130+
121131
# ------------------------------------
122132
# nftables
123133
# ------------------------------------
@@ -158,6 +168,12 @@ fi
158168

159169
set_local_port
160170

171+
if [ ! -e /usr/sbin/crowdsec-firewall-bouncer ]; then
172+
if [ ! -L /usr/sbin ]; then
173+
ln -s ../bin/crowdsec-firewall-bouncer /usr/sbin/crowdsec-firewall-bouncer
174+
fi
175+
fi
176+
161177
%systemd_post %{name}.service
162178

163179
if [ "$START" -eq 0 ]; then
@@ -184,3 +200,7 @@ fi
184200
if [ "$1" = "1" ]; then
185201
systemctl restart %{name} || echo "cannot restart service"
186202
fi
203+
204+
if [ -L /usr/sbin/crowdsec-firewall-bouncer ]; then
205+
rm -f /usr/sbin/crowdsec-firewall-bouncer
206+
fi

0 commit comments

Comments
 (0)