Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ nginx/custom/*
php/custom/*
ols/*
custom/*
config_backup/*
42 changes: 42 additions & 0 deletions scripts/8g-firewall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail

# Cleanup temp files on exit
trap 'rm -f /tmp/8g-firewall-config-*' EXIT

# Download and update configuration files
# Run from: {SITE_DIR}/config directory

# Configuration
BASE_URL="https://raw.githubusercontent.com/t18d/nG-SetEnvIf/develop"
FILES=(8g.conf 8g-firewall.conf)

for filename in "${FILES[@]}"; do
dest_path="./nginx/common/$filename"
url="$BASE_URL/$filename"
tmpfile="/tmp/8g-firewall-config-$(date +%s)-$(basename "$filename")"

echo "Processing: $filename"

# Download file
if ! curl -fsSL -o "$tmpfile" "$url"; then
echo "❌ Failed to download"
rm -f "$tmpfile"
continue
fi

# Skip if unchanged
if [ -f "$dest_path" ] && cmp -s "$tmpfile" "$dest_path"; then
echo "✅ No changes"
rm -f "$tmpfile"
continue
fi

# Install new file
mkdir -p "$(dirname "$dest_path")"
mv "$tmpfile" "$dest_path"
chmod 0644 "$dest_path"
echo "✅ Updated: $dest_path"
done

echo "Add Done!"
116 changes: 0 additions & 116 deletions scripts/update-8g-firewall.sh

This file was deleted.