rc.local 1.3 KB

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