feature: Add helper scripts to repo

This commit is contained in:
dev
2026-01-01 19:23:51 +00:00
parent ae491f1720
commit bb621fb745
2 changed files with 216 additions and 0 deletions

26
helpers/wo-fix-perms.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "Usage: $0 example.com" >&2
exit 1
fi
domain="$1"
root="/var/www/$domain"
if [[ ! -d "$root" ]]; then
echo "Site root not found: $root" >&2
exit 1
fi
echo "Normalizing ownership and permissions under $root"
# Ownership
chown -R root:webdev "$root"
# Directories: 2775, Files: 664
find "$root" -type d -exec chmod 2775 {} \;
find "$root" -type f -exec chmod 664 {} \;
echo "Done."