Compare commits
2 Commits
d45c9a0fbe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e9a56c232 | ||
|
|
b81160d3b9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,4 +13,6 @@ docker-compose.yml
|
||||
compose.yaml
|
||||
compose.yml
|
||||
docker-compose.env
|
||||
docker-compose.override.yaml
|
||||
docker-compose.override.yml
|
||||
.env
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copy all .conf files from source to destination
|
||||
cp /mnt/place-config/etc/nginx/sites-available/*.conf /etc/nginx/sites-available/
|
||||
# Source and destination directories
|
||||
SRC_DIR="/mnt/place-config/etc/nginx/sites-available"
|
||||
SITES_AVAILABLE="/etc/nginx/sites-available"
|
||||
SITES_ENABLED="/etc/nginx/sites-enabled"
|
||||
|
||||
# Check if source directory exists
|
||||
if [ ! -d "$SRC_DIR" ]; then
|
||||
echo "Error: Source directory $SRC_DIR does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create destination directories if they don't exist
|
||||
mkdir -p "$SITES_AVAILABLE"
|
||||
mkdir -p "$SITES_ENABLED"
|
||||
|
||||
# Copy all .conf files from source to sites-available
|
||||
echo "Copying .conf files from $SRC_DIR to $SITES_AVAILABLE..."
|
||||
cp -v "$SRC_DIR"/*.conf "$SITES_AVAILABLE/"
|
||||
|
||||
# Create symbolic links in sites-enabled
|
||||
echo "Creating symbolic links in $SITES_ENABLED..."
|
||||
for config_file in "$SITES_AVAILABLE"/*.conf; do
|
||||
if [ -f "$config_file" ]; then
|
||||
filename=$(basename "$config_file")
|
||||
# Remove existing link/file if it exists
|
||||
if [ -e "$SITES_ENABLED/$filename" ] || [ -L "$SITES_ENABLED/$filename" ]; then
|
||||
rm -f "$SITES_ENABLED/$filename"
|
||||
fi
|
||||
# Create symbolic link
|
||||
ln -sf "$config_file" "$SITES_ENABLED/$filename"
|
||||
echo "Linked: $SITES_ENABLED/$filename -> $config_file"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Operation completed successfully!"
|
||||
|
||||
Reference in New Issue
Block a user