Explorar el Código

helper scripts

Danja Vasiliev hace 10 años
padre
commit
dcb2ab2e5d

+ 11 - 10
openwrt/dir505/etc/config/fstab

@@ -1,18 +1,19 @@
 config 'global'
-  option  'anon_swap'   '1'
-  option  'anon_mount'  '1'
-  option  'auto_swap'   '1'
-  option  'auto_mount'  '1'
+  option  'anon_swap'   '0'
+  option  'anon_mount'  '0'
+  option  'auto_swap'   '0'
+  option  'auto_mount'  '0'
   option  'delay_root'  '5'
   option  'check_fs'    '0'
 
 config 'global' 'automount'
-  option  'from_fstab'  '1'
-  option  'anon_mount'  '1'
+  option  'from_fstab'  '0'
+  option  'anon_mount'  '0'
 
 config 'mount'
-  option 'label'  'superglue'
-  option 'enabled'    '1'
-  option 'enabled_fsck'   '0'
-  option 'options'  'remount,rw,nosuid,noatime'
+  option 'label'        'superglue'
+  option 'target'       '/www/htdocs'
+  option 'enabled'      '1'
+  option 'enabled_fsck' '0'
+  option 'options'      'rw,noatime'
 

+ 2 - 2
openwrt/dir505/etc/lighttpd/lighttpd.conf

@@ -14,8 +14,8 @@ server.modules = (
 
 server.document-root = "/www/htdocs"
 server.upload-dirs = ( "/www/tmp" )
-server.errorlog = "/www/tmp/lighttpd-error.log"
-accesslog.filename = "/www/tmp/lighttpd-access.log"
+server.errorlog = "/tmp/lighttpd-error.log"
+accesslog.filename = "/tmp/lighttpd-access.log"
 server.pid-file = "/var/run/lighttpd.pid"
 server.username = "httpd"
 server.groupname = "www-data"

+ 22 - 0
openwrt/dir505/etc/rc.local

@@ -0,0 +1,22 @@
+# some checks specific to SuperGlue
+
+## if /www is mounted
+mountpoint -q /www && (
+
+  ## if not writable chown with httpd
+  [ $(stat /www -c %U) != 'httpd' ] && chown -R httpd /www
+  [ $(stat /www -c %a) -lt '755' ] && chmod -R u+rwX /www
+
+  ## if /www/tmp does not exist
+  [ ! -d /www/tmp ] && (
+    mkdir /www/tmp
+    chown -R httpd /www/tmp
+  )
+  ## if /www/htdocs does not exits
+  [ ! -d /www/htdocs ] && (
+    mkdir /www/htdocs
+    chown -R httpd /www/htdocs
+  )
+)
+
+exit 0