mirror of
https://git.freebsd.org/ports.git
synced 2025-05-16 01:01:49 -04:00
- 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
18 lines
436 B
Bash
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
|