Skip to content

Commit

Permalink
Merge pull request #11 from crowdsecurity/enable_service
Browse files Browse the repository at this point in the history
enable service at boot
  • Loading branch information
AlteredCoder authored Dec 1, 2020
2 parents 6a6021b + 736d4e0 commit 05ac9de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ check_firewall() {
fi

if [ "$nftables" = "true" -a "$iptables" = "true" ]; then
echo "Found nftables and iptables, which firewall do you want to use (nftables/iptables)?"
echo "Found nftables(default) and iptables, which firewall do you want to use (nftables/iptables)?"
read answer
if [ "$answer" = "iptables" ]; then
FW_BACKEND="iptables"
Expand Down Expand Up @@ -97,11 +97,16 @@ install_firewall_bouncer() {
}



if ! [ $(id -u) = 0 ]; then
log_err "Please run the install script as root or with sudo"
exit 1
fi
check_pkg_manager
check_firewall
echo "Installing firewall-bouncer"
install_firewall_bouncer
gen_apikey
gen_config_file
systemctl enable cs-firewall-bouncer.service
systemctl start cs-firewall-bouncer.service
echo "The firewall-bouncer service has been installed!"
3 changes: 1 addition & 2 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

BIN_PATH_INSTALLED="/usr/local/bin/cs-firewall-bouncer"
CONFIG_DIR="/etc/crowdsec/cs-firewall-bouncer/"
PID_DIR="/var/run/crowdsec/"
LOG_FILE="/var/log/cs-firewall-bouncer.log"
SYSTEMD_PATH_FILE="/etc/systemd/system/cs-firewall-bouncer.service"

Expand All @@ -16,4 +15,4 @@ uninstall() {

uninstall

echo "firewall-bouncer uninstall successfully"
echo "cs-firewall-bouncer uninstall successfully"

0 comments on commit 05ac9de

Please sign in to comment.