aboutsummaryrefslogtreecommitdiff
path: root/security/crowdsec/files/pkg-install.in
blob: d0a9fe85d3b414a79d34e2fd7250e8edf32abca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# shellcheck disable=SC2249
case $2 in
        "POST-INSTALL")
                echo "Updating crowdsec hub data"
                if cscli hub update -o human --error; then
                    cscli hub upgrade -o human --error
                else
                    echo "Failed to update crowdsec hub data."
                    echo "You can run 'cscli hub update; cscli hub upgrade'"
                    echo "to update manually, or let the cron job do it for you."
                fi
                if [ -e /var/run/crowdsec.running ]; then
                    service crowdsec onestart
                    rm -f /var/run/crowdsec.running
                fi
                ;;
esac