Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak fedora Zone #590

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Tweak fedora Zone
o0101 committed Dec 9, 2023
commit 3dc52caaa7619e40a638a3ab36751a08885ee36c
17 changes: 11 additions & 6 deletions deploy-scripts/_setup_bbpro.sh
Original file line number Diff line number Diff line change
@@ -5,11 +5,21 @@ ONTOR=false
TOR_PROXY=""
INJECT_SCRIPT=""
SUDO=""
ZONE=""

# Function to check if a command exists
command_exists() {
command -v "$@" > /dev/null 2>&1
}

if command_exists sudo; then
SUDO="sudo"
fi

if command_exists firewall-cmd; then
ZONE="$(sudo firewall-cmd --get-default-zone)"
fi

# Function to display help message
display_help() {
cat << EOF
@@ -79,11 +89,6 @@ is_port_free() {
return 0
}

# Function to check if a command exists
command_exists() {
command -v "$@" > /dev/null 2>&1
}

# Detect Operating System
detect_os() {
if command_exists lsb_release ; then
@@ -219,7 +224,7 @@ open_firewall_port_range() {
# Check for firewall-cmd (firewalld)
if command -v firewall-cmd &> /dev/null; then
echo "Using firewalld"
$SUDO firewall-cmd --zone=public --add-port=${start_port}-${end_port}/tcp --permanent
$SUDO firewall-cmd --zone="$ZONE" --add-port=${start_port}-${end_port}/tcp --permanent
$SUDO firewall-cmd --reload
# Check for ufw (Uncomplicated Firewall)
elif command -v ufw &> /dev/null; then
11 changes: 8 additions & 3 deletions deploy-scripts/global_install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

ZONE=""
#set -x

unset npm_config_prefix
@@ -14,6 +15,10 @@ if command -v sudo; then
SUDO="sudo"
fi

if command -v firewall-cmd; then
ZONE="$(sudo firewall-cmd --get-default-zone)"
fi

initialize_package_manager() {
local package_manager

@@ -25,8 +30,8 @@ initialize_package_manager() {
$SUDO dnf -y upgrade --refresh
$SUDO dnf install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
$SUDO dnf install https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm
$SUDO firewall-cmd --permanent --zone=public --add-service=http
$SUDO firewall-cmd --permanent --zone=public --add-service=https
$SUDO firewall-cmd --permanent --zone="$ZONE" --add-service=http
$SUDO firewall-cmd --permanent --zone="$ZONE" --add-service=https
$SUDO firewall-cmd --reload
$SUDO dnf -y install wget tar
mkdir -p $HOME/build/Release
@@ -185,7 +190,7 @@ open_firewall_port_range() {
# Check for firewall-cmd (firewalld)
if command -v firewall-cmd &> /dev/null; then
echo "Using firewalld"
$SUDO firewall-cmd --zone=public --add-port=${start_port}-${end_port}/tcp --permanent
$SUDO firewall-cmd --zone="$ZONE" --add-port=${start_port}-${end_port}/tcp --permanent
$SUDO firewall-cmd --reload
complete="true"
fi
7 changes: 6 additions & 1 deletion deploy-scripts/run_docker.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@

# Detect operating system
OS=$(uname)
ZONE=""

if command -v firewall-cmd; then
ZONE="$(sudo firewall-cmd --get-default-zone)"
fi

## Check if running on macOS
#if [ "$OS" == "Darwin" ]; then
@@ -115,7 +120,7 @@ open_firewall_port_range() {
# Check for firewall-cmd (firewalld)
if command -v firewall-cmd &> /dev/null; then
echo "Using firewalld"
firewall-cmd --zone=public --add-port=${start_port}-${end_port}/tcp --permanent
firewall-cmd --zone="$ZONE" --add-port=${start_port}-${end_port}/tcp --permanent
firewall-cmd --reload

# Check for ufw (Uncomplicated Firewall)