crowdsec update automation

After updating crowdsec I’ve noticed, that there are quite a few manual tasks to finalize the update process.
Obvious solution to this is to automate the process.

Here is what I came up with:

#!/bin/bash

#Update hub
cscli hub update

for DATA in $(cscli hub list -o raw|grep update-available|cut -f 6 -d ","|sort -u)
do
echo $DATA
cscli $DATA upgrade --all
systemctl reload crowdsec
done

Your comments and improvements are more than welcome.

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.