ports/security/crowdsec/files/upgrade-hub.in
marco 0581f05699 security/crowdsec: update to v1.6.1
-  improve rc, postinst scripts
- update upstream to latest stable
- restart service correctly if it crashes
- update hub in postinst (if network available) instead of service start
- use "one{status,stop...}" for compatibility with pfsense
- patch: fix network fs detection

PR:	278713
2024-05-03 15:48:51 +02:00

18 lines
436 B
Bash

#!/bin/sh
test -x %%PREFIX%%/bin/cscli || exit 0
# splay hub upgrade and crowdsec reload
sleep "$(jot -r 1 1 300)"
# favor the opnsense plugin's cron if it's there
test -e /usr/local/etc/cron.d/oscrowdsec.cron && exit 0
%%PREFIX%%/bin/cscli --error -o human hub update
upgraded=$(%%PREFIX%%/bin/cscli --error -o human hub upgrade)
if [ -n "$upgraded" ]; then
service crowdsec onestatus && service crowdsec onereload
fi
exit 0