Advertisement
leonteale

Plesk domain folder permission reset

Dec 10th, 2013
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.92 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo_stderr() {
  4.         echo -e "$1" >&2
  5. }
  6.  
  7.  
  8. usage() {
  9.         echo_stderr "Usage:\n\t$0 DOMAIN.NAME"
  10. }
  11.  
  12. if [ -z "$1" ] ;then
  13.         usage
  14.         exit 1
  15. else
  16. echo "SELECT d.name, h.www_root, s.login FROM domains d, hosting h, sys_users s WHERE s.id=h.sys_user_id AND h.dom_id=d.id AND d.name='$1'" | mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa | while read domain www user; do
  17. {
  18. cat <<-EOFedec8516cd5ed05ce745b2fb74620053
  19. <HTTPD_VHOSTS_D>:$domain:root:root:0755:::0
  20. <HTTPD_VHOSTS_D>/$domain:$www:$user:<PSASERV>:0750:::0
  21.  :$www/picture_library:$user:psacln:0755:::0
  22.  :$www/cgi-bin:$user:<PSASERV>:0750:::0
  23.  :<HTTPD_VHOSTS_D>/$domain/error_docs:root:<PSASERV>:0755:::0
  24.  :anon_ftp:$user:<PSASERV>:0750:::0
  25.  :anon_ftp/pub:$user:<PSASERV>:0755:::0
  26.  :anon_ftp/conf:root:<PSASERV>:0755:::0
  27.  :anon_ftp/incoming:$user:<PSASERV>:0777:::0
  28.  :conf:root:<PSASERV>:0750:::0
  29.  :pd:root:<PSASERV>:0750:::0
  30.  :web_users:root:<PSASERV>:0755:::0
  31.  :subdomains:root:<PSASERV>:0755:::0
  32.  :private:$user:root:0700:::0
  33.  :statistics:$user:<PSASERV>:0550:::0
  34.  :statistics/logs:$user:<PSASERV>:0550:::0
  35.  :statistics/webstat:root:root:0755:::0
  36.  :statistics/webstat-ssl:root:root:0755:::0
  37.  :statistics/anon_ftpstat:root:root:0755:::0
  38.  :statistics/ftpstat:root:root:0755:::0
  39. $www:plesk-stat:root:root:0755:::0
  40. $www:$www:$user:psacln:0755:0644:0:0
  41.  :plesk-stat:root:root:0755:0644:1:0
  42.  :test/fcgi:$user:psacln:0755:0755:0:0
  43. <HTTPD_VHOSTS_D>/$domain:anon_ftp/pub:$user:psacln:0755:0644:0:0
  44.  :statistics/webstat:root:<PSASERV>:0755:0644:0:0
  45.  :statistics/webstat-ssl:root:<PSASERV>:0755:0644:0:0
  46.  :statistics/ftpstat:root:<PSASERV>:0755:0644:0:0
  47.  :statistics/anon_ftpstat:root:<PSASERV>:0755:0644:0:0
  48.  :$www/cgi-bin:$user:psacln:0755:0755:0:0
  49.  :<HTTPD_VHOSTS_D>/$domain/error_docs:$user:psacln:0755:0644:0:0
  50.  :<HTTPD_VHOSTS_D>/$domain:::::1:1
  51. EOFedec8516cd5ed05ce745b2fb74620053
  52. } | /usr/local/psa/admin/sbin/dirmng -c -p
  53. done
  54. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement