update
This commit is contained in:
parent
ecd39d2098
commit
b0fb358124
@ -1,22 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
OS_ARCH=$(dpkg --print-architecture) || (echo "Not Debian Based Distro" && exit 1)
|
||||
OS_CODE=$(source /etc/os-release && echo "$VERSION_CODENAME")
|
||||
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
AWD=$(dirname "$SCRIPT")
|
||||
|
||||
main(){
|
||||
echo "deb https://packagecloud.io/crowdsec/crowdsec/debian/ $OS_CODE main" | \
|
||||
tee /etc/apt/sources.list.d/crowdsec_crowdsec.list
|
||||
curl -fsSL "https://packagecloud.io/crowdsec/crowdsec/gpgkey" $SET_PROXY | \
|
||||
gpg --dearmor | tee /etc/apt/trusted.gpg.d/crowdsec_crowdsec-archive-keyring.gpg > /dev/null
|
||||
|
||||
echo "crowdsec crowdsec-firewall-bouncer-iptables" | $AWD/install.sh
|
||||
}
|
||||
|
||||
setup(){
|
||||
echo "crowdsec crowdsec-firewall-bouncer-iptables" | $AWD/install.sh
|
||||
|
||||
echo -e "db_config:
|
||||
use_wal: true" | tee /etc/crowdsec/config.yaml.local
|
||||
|
||||
@ -44,19 +32,13 @@ whitelist:
|
||||
usage(){
|
||||
echo "Usage: $0 [OPTIONS]";
|
||||
echo "OPTIONS:";
|
||||
echo " -s skip setup";
|
||||
echo " -x <PROXY> Proxy [protocol://]host[:port]";
|
||||
echo " -h show this help";
|
||||
}
|
||||
|
||||
DO_SETUP=true;
|
||||
SET_PROXY=;
|
||||
while getopts ":sx:" OPT; do
|
||||
while getopts ":h" OPT; do
|
||||
case $OPT in
|
||||
s)
|
||||
DO_SETUP=false;
|
||||
;;
|
||||
x)
|
||||
SET_PROXY="-x $OPTARG";
|
||||
h)
|
||||
usage;
|
||||
;;
|
||||
?)
|
||||
echo "Invalid Option: -$OPTARG";
|
||||
@ -65,7 +47,4 @@ while getopts ":sx:" OPT; do
|
||||
esac;
|
||||
done;
|
||||
|
||||
main
|
||||
if $DO_SETUP; then
|
||||
setup
|
||||
fi;
|
||||
setup;
|
||||
Loading…
Reference in New Issue
Block a user