rc.local 745 B

12345678910111213141516171819202122232425262728293031323334
  1. ## some checks specific to SuperGlue
  2. ## where SuperGlue storage is mounted
  3. _SG=/www/htdocs
  4. ## mount if needed
  5. mountpoint -q $_SG || block mount $_SG
  6. ## if /www is mounted
  7. mountpoint -q $_SG && (
  8. ## if not writable chown with httpd
  9. [ $(stat $_SG -c %U) != 'httpd' ] && chown -R httpd $_SG
  10. [ $(stat $_SG -c %a) -lt '755' ] && chmod -R u+rwX $_SG
  11. ## check if index.html is present
  12. [ -e $_SG/index.html ] || (
  13. cp /www/lib/resources/index.html $_SG
  14. chown httpd $_SG/index.html
  15. )
  16. ## check symlinking
  17. for i in devTools resources templates; do
  18. [ -L $_SG/$i ] || ln -s /www/lib/$i $_SG/$i
  19. done
  20. ## if /www/tmp does not exist
  21. # [ -d $_SG/tmp ] || (
  22. # mkdir $_SG/tmp && chown httpd $_SG/tmp
  23. # )
  24. )
  25. exit 0