Lines 49-55
crowdsec_firewall_precmd() {
Link Here
|
49 |
# THEN, register it to the local API |
49 |
# THEN, register it to the local API |
50 |
API_KEY=$($CSCLI bouncers add "${crowdsec_firewall_name}" -o raw) |
50 |
API_KEY=$($CSCLI bouncers add "${crowdsec_firewall_name}" -o raw) |
51 |
if [ -n "$API_KEY" ]; then |
51 |
if [ -n "$API_KEY" ]; then |
52 |
sed -i "" "s|^${orig_line}|api_key: ${API_KEY} # ${crowdsec_firewall_name}|" "${crowdsec_firewall_config}" |
52 |
sed -i "" "s|^${orig_line}|api_key: '${API_KEY}'|" "${crowdsec_firewall_config}" |
53 |
echo "Registered: ${crowdsec_firewall_name}" |
53 |
echo "Registered: ${crowdsec_firewall_name}" |
54 |
fi |
54 |
fi |
55 |
fi |
55 |
fi |
Lines 85-90
crowdsec_firewall_stop()
Link Here
|
85 |
crowdsec_firewall_start() { |
85 |
crowdsec_firewall_start() { |
86 |
# ensure we have a backend if the config file was not patched |
86 |
# ensure we have a backend if the config file was not patched |
87 |
export BACKEND=pf |
87 |
export BACKEND=pf |
|
|
88 |
# shellcheck disable=SC2086 |
88 |
/usr/sbin/daemon -f -p "$pidfile" -t "$desc" -- \ |
89 |
/usr/sbin/daemon -f -p "$pidfile" -t "$desc" -- \ |
89 |
"$command" -c "$crowdsec_firewall_config" ${crowdsec_firewall_flags} |
90 |
"$command" -c "$crowdsec_firewall_config" ${crowdsec_firewall_flags} |
90 |
} |
91 |
} |
91 |
- |
|
|