rc.local 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #mountpoint -q $_SG || mount -L sg-user -o rw,noatime,nodiratime $_SG
  7. ## this seems to be the only way to mount btrfs on boot, ups ## (sleep 15; mount /dev/sda3 -o rw,noatime,nodiratime $_SG
  8. ## if /www/htdocs is mounted
  9. mountpoint -q $_SG && (
  10. ## if not writable chown with httpd
  11. [ $(stat $_SG -c %U) != 'httpd' ] && chown -R httpd $_SG
  12. [ $(stat $_SG -c %a) -lt '755' ] && chmod -R u+rwX $_SG
  13. ## check if index.html is present
  14. [ -e $_SG/index.html ] || (
  15. cp /www/lib/resources/index.html $_SG/default.html
  16. chown httpd $_SG/default.html
  17. )
  18. ## check for log directory
  19. [ -e $_SG/logs ] || ( mkdir $_SG/logs
  20. chown httpd $_SG/logs
  21. )
  22. ## check for tmp directory
  23. [ -e $_SG/tmp ] || ( mkdir $_SG/tmp
  24. chown httpd $_SG/tmp
  25. )
  26. ## check symlinking
  27. # for i in devTools resources templates; do
  28. # [ -L $_SG/$i ] || ln -s /www/lib/$i $_SG/$i
  29. # done
  30. ## if /www/tmp does not exist
  31. # [ -d $_SG/tmp ] || (
  32. # mkdir $_SG/tmp && chown httpd $_SG/tmp
  33. # )
  34. ## needed to make lighty use mounted location for logs
  35. /etc/init.d/lighttpd restart
  36. )&
  37. exit 0