✨feature: Add helper scripts to repo
This commit is contained in:
26
helpers/wo-fix-perms.sh
Executable file
26
helpers/wo-fix-perms.sh
Executable 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."
|
||||
Reference in New Issue
Block a user