Just log in with your secure internet shell to change this file!

me: yea.. added a few words already..
me update: actually..its quite a lot now..do you like it?

You may want to read: How to ~tilde: Getting Started for help.

me: ok..sure

Check out your new blog!

me: nice.. thank you..

04:58:26 up 303 days, 9:52, 457 users, load average: 8.23, 4.77, 3.42

Name:

Message:

Do you want to delete this note?



Date: November 06, 2024 - 02:34 PM - 175.139.235.17
xev wrote:

#!/bin/bash

# Specify the root directory where you want to start the search
root_dir="$1" # Takes the root directory as a command-line argument

# Function to check and add index.html
add_index_html() {
local dir=$1

# Check if index.php or index.html already exists in the directory
if [[ ! -f "$dir/index.php" && ! -f "$dir/index.html" ]]; then
echo "Adding index.html in $dir"

# Create the custom index.html with 404 title and blank content
cat <<EOF > "$dir/index.html"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404</title>
</head>
<body>
</body>
</html>
EOF
fi
}

# Export function for use with find command
export -f add_index_html

# Start from the root directory and find all subdirectories
find "$root_dir" -type d -exec bash -c 'add_index_html "$0"' {} \;

echo "Done!"




Password: