Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit eb12afc

Browse files
authored
Merge pull request #9 from jonhattan/update-install
Update install
2 parents e834198 + 3a26110 commit eb12afc

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,22 @@ In UNIX terms:
4242

4343
Clone or download the repository content to your server.
4444

45-
Link to `drupal_fix_permissions.sh` in the `/usr/local/bin` or another folder present in the user's PATH.
45+
Two scripts are provided:
4646

47-
If you are using `autofix-drupal-perms.sh`, link it as well. Because it expects `drupal_fix_permissions.sh` to be at `/usr/local/bin` make sure that path exists or edit the autofix script.
47+
* `drupal_fix_permissions.sh`: Main script that actually does the work
48+
* `autofix-drupal-perms.sh`: Wrapper to invoke `drupal_fix_permissions.sh`
49+
with predefined parameters. It is handy to configure in sudoers.
4850

49-
If required, edit your sudo configuration to allow users to run `drupal_fix_permissions.sh` as root.
51+
If `autofix-drupal-perms.sh` fits your needs just symlink it into `/usr/local/bin`
52+
or another location reachable from the user's PATH.
53+
54+
Otherwise, you can create your own wrapper or invoke `drupal_fix_permissions.sh` directly.
55+
56+
### Permissions
57+
58+
In order to manipulate files/folders ownership and permissions the script must be run as root.
59+
You may need to configure your sudoers file to allow for that. An example is included in
60+
`autofix-drupal-perms.sudoers.example` file.
5061

5162

5263
## Usage
@@ -108,20 +119,3 @@ The script only changes the files and folders with the wrong permissions or
108119
ownership, making it very fast when only a few files or folders need a fix. For
109120
really large installations this is very important as other scripts update
110121
permissions and ownership regardless of whether they are needed or not.
111-
112-
## Root permissions
113-
114-
Giving root permissions to regular users is dangerous. Luckily, there's a simple
115-
script, `autofix-drupal-perms.sh`, to allow regular users to fix their sites
116-
without risking the security.
117-
118-
This script has no parameters, so it can be easily added to the sudoers. When
119-
run, it calls the main script with predefined parameters:
120-
121-
- deploy user: the owner of the current folder
122-
- additional content folders: ../private and ../private-files
123-
124-
The script is an example, you can customize it for your hosting needs.
125-
126-
This repository also includes a sudoers file example to allow users to run the
127-
script using sudo.

autofix-drupal-perms.sh

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
SCRIPT_DIR="$( cd "$( dirname $(realpath "${BASH_SOURCE[0]}") )" && pwd )"
4+
35
deploy_user=$(stat -c '%U' .)
46

5-
/usr/local/bin/drupal-fix-permissions -s -u=$deploy_user -f=../private -f=../private-files
7+
$SCRIPT_DIR/drupal_fix_permissions.sh -s -u=$deploy_user -f=../private -f=../private-files

0 commit comments

Comments
 (0)