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."
|