## some checks specific to Superglue ## where Superglue storage is mounted _SG=/www/htdocs ## mount if needed #mountpoint -q $_SG || block mount $_SG #mountpoint -q $_SG || mount -L sg-user -o rw,noatime,nodiratime $_SG ## this seems to be the only way to mount btrfs on boot, ups ## (sleep 15; mount /dev/sda3 -o rw,noatime,nodiratime $_SG ## if /www/htdocs is mounted mountpoint -q $_SG && ( ## if not writable chown with httpd [ $(stat $_SG -c %U) != 'httpd' ] && chown -R httpd $_SG [ $(stat $_SG -c %a) -lt '755' ] && chmod -R u+rwX $_SG ## check if index.html is present [ -e $_SG/index.html ] || ( cp /www/lib/resources/index.html $_SG/default.html chown httpd $_SG/default.html ) ## check for log directory [ -e $_SG/logs ] || ( mkdir $_SG/logs chown httpd $_SG/logs ) ## check for tmp directory [ -e $_SG/tmp ] || ( mkdir $_SG/tmp chown httpd $_SG/tmp ) ## check symlinking # for i in devTools resources templates; do # [ -L $_SG/$i ] || ln -s /www/lib/$i $_SG/$i # done ## if /www/tmp does not exist # [ -d $_SG/tmp ] || ( # mkdir $_SG/tmp && chown httpd $_SG/tmp # ) ## needed to make lighty use mounted location for logs /etc/init.d/lighttpd restart )& exit 0