File: upgrade.sh

package info (click to toggle)
crowdsec-custom-bouncer 0.0.15-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 652 kB
  • sloc: sh: 171; makefile: 65
file content (20 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
BIN_PATH_INSTALLED="/usr/local/bin/crowdsec-custom-bouncer"
BIN_PATH="./crowdsec-custom-bouncer"


upgrade_bin() {
    rm "${BIN_PATH_INSTALLED}" || (echo "crowdsec-custom-bouncer is not installed, exiting." && exit 1)
    install -v -m 755 -D "${BIN_PATH}" "${BIN_PATH_INSTALLED}"
}


if ! [ $(id -u) = 0 ]; then
    log_err "Please run the upgrade script as root or with sudo"
    exit 1
fi

systemctl stop crowdsec-custom-bouncer
upgrade_bin
systemctl start crowdsec-custom-bouncer
echo "crowdsec-custom-bouncer upgraded successfully."