This commit is contained in:
hl committed 2024-11-01 23:39:47 +08:00
1 parent 893bf13667
commit cf22356a8e
1 file changed
+25 -1
+25 -1
View File
@@ -14,7 +14,9 @@ main(){
command -v $command &>/dev/null || command="apt"
$command update
$command install -y crowdsec crowdsec-firewall-bouncer-iptables
}
setup(){
echo -e "db_config:
use_wal: true" | tee /etc/crowdsec/config.yaml.local
@@ -39,4 +41,26 @@ whitelist:
systemctl reload crowdsec
}
main;
usage(){
echo "Usage: $0 [OPTIONS]";
echo "OPTIONS:";
echo " -i install only";
}
INSTALL_ONLY=0;
while getopts ":i" OPT; do
case $OPT in
i)
INSTALL_ONLY=1;
;;
?)
echo "Invalid Option: -$OPTARG";
usage;
exit 1;;
esac;
done;
main;
if [ $INSTALL_ONLY -eq 0 ]; then
setup;
fi;