aboutsummaryrefslogtreecommitdiff
path: root/security/crowdsec/files/upgrade-hub.in
diff options
context:
space:
mode:
Diffstat (limited to 'security/crowdsec/files/upgrade-hub.in')
-rw-r--r--security/crowdsec/files/upgrade-hub.in11
1 files changed, 6 insertions, 5 deletions
diff --git a/security/crowdsec/files/upgrade-hub.in b/security/crowdsec/files/upgrade-hub.in
index 2364169f4425..b5b6fd2565c5 100644
--- a/security/crowdsec/files/upgrade-hub.in
+++ b/security/crowdsec/files/upgrade-hub.in
@@ -1,16 +1,17 @@
#!/bin/sh
-test -x /usr/local/bin/cscli || exit 0
+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
-/usr/local/bin/cscli --error -o human hub update
+%%PREFIX%%/bin/cscli --error -o human hub update
-upgraded=$(/usr/local/bin/cscli --error -o human hub upgrade)
+upgraded=$(%%PREFIX%%/bin/cscli --error -o human hub upgrade)
if [ -n "$upgraded" ]; then
- # splay initial metrics push
- sleep "$(jot -r 1 1 60)"
service crowdsec onestatus && service crowdsec onereload
fi