rc.local 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/default.html
  14. chown httpd $_SG/default.html
  15. )
  16. ## check for log directory
  17. [ -e $_SG/log ] || ( mkdir $_SG/log
  18. chown httpd $_SG/log
  19. }
  20. ## check for tmp directory
  21. [ -e $_SG/tmp ] || ( mkdir $_SG/tmp
  22. chown httpd $_SG/tmp
  23. }
  24. ## check symlinking
  25. # for i in devTools resources templates; do
  26. # [ -L $_SG/$i ] || ln -s /www/lib/$i $_SG/$i
  27. # done
  28. ## if /www/tmp does not exist
  29. # [ -d $_SG/tmp ] || (
  30. # mkdir $_SG/tmp && chown httpd $_SG/tmp
  31. # )
  32. )
  33. exit 0