make script a little nicer (thx shellcheck)

rugk 2017-11-25 19:16:10 +01:00
parent c70d2224a5
commit cb042167fd

9
FAQ.md

@ -233,18 +233,19 @@ The permissions need to look like this:
For most setups it is also possible to use the following script. Make sure to edit the users and folders where necessary.
```sh
#!/bin/sh
pbpath='/var/www/privatebin'
pbdata='/var/www/privatebin/data'
htuser='www-data'
# htuser='www-data' (unused)
htgroup='www-data'
rootuser='root'
printf "chmod Files and Directories\n"
echo "[chmod] files and directories"
find ${pbpath}/ -type f -print0 | xargs -0 chmod 0640
find ${pbpath}/ -type d -print0 | xargs -0 chmod 0550
find ${pbdata}/ -type f -print0 | xargs -0 chmod 0640
find ${pbdata}/ -type d -print0 | xargs -0 chmod 0750
printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${pbpath}/
echo "[chown] Directories"
chown -R ${rootuser}:${htgroup} "${pbpath}/"
```