#!/bin/bash # Ensure the script is run with exactly two arguments if [ $# -ne 2 ]; then echo "Usage: $0 " exit 1 fi # Define variables path="$1" name="$2" # Create the folder structure mkdir -p "$path/$name/_werc" "$path/$name/blog/_werc" # Create the first config file (not under blog) cat > "$path/$name/_werc/config" < "$path/$name/blog/_werc/config" < "$path/$name/_werc/style.css" # Update index.html index_file="$path/index.html" if [ -f "$index_file" ]; then awk -v name="$name" ' { print if ($0 ~ //) { print "
" print " \""" print "
" print "" } }' "$index_file" > "${index_file}.tmp" && mv "${index_file}.tmp" "$index_file" echo "Updated index.html with new user entry" else echo "Warning: index.html not found at $index_file" fi # Output a success message echo "Folder structure created successfully at $path/$name"