Browse Source

WRT160NL updates

Danja Vasiliev 10 years ago
parent
commit
ef76d198dc

BIN
openwrt/.make_fw.sh.swo


+ 21 - 0
openwrt/WRT160NL/etc/config/network

@@ -0,0 +1,21 @@
+config interface 'loopback'
+	option ifname 'lo'
+	option proto 'static'
+	option ipaddr '127.0.0.1'
+	option netmask '255.0.0.0'
+
+config globals 'globals'
+	option ula_prefix 'fd2c:90fd:3f5a::/48'
+
+config interface 'lan'
+	option ifname 'eth0'
+	option force_link '1'
+	option type 'bridge'
+	option proto 'static'
+	option ipaddr '192.168.1.1'
+	option netmask '255.255.255.0'
+	option ip6assign '60'
+
+config interface 'wan'
+	option ifname 'eth1'
+	option proto 'dhcp'

+ 1 - 2
openwrt/WRT160NL/etc/config/system

@@ -1,7 +1,6 @@
-
 config system
 	option hostname 'superglue'
-  ## Made in Berlin
+	## Made in Berlin
 	option timezone 'CET-1CEST'
 
 config timeserver 'ntp'

+ 15 - 0
openwrt/WRT160NL/etc/config/wireless

@@ -0,0 +1,15 @@
+config wifi-device 'radio0'
+	option type 'mac80211'
+	option channel '11'
+	option hwmode '11g'
+	option path 'platform/ath9k'
+	option htmode 'HT20'
+	option disabled '1'
+
+config wifi-iface
+	option device 'radio0'
+	option network 'lan'
+	option mode 'ap'
+	option ssid 'OpenWrt'
+	option encryption 'none'
+

+ 1 - 0
openwrt/WRT160NL/etc/superglue_model

@@ -0,0 +1 @@
+Linksys WRT160NL

+ 1 - 1
openwrt/common/etc/config/dhcp

@@ -7,7 +7,7 @@ config dnsmasq
 	option rebind_protection '1'
 	option rebind_localhost '1'
 	option local '/local/'
-	option domain 'home'
+	option domain 'local'
 	option expandhosts '1'
 	option nonegcache '0'
 	option authoritative '1'

+ 6 - 6
openwrt/common/etc/config/fstab

@@ -11,12 +11,12 @@ config 'global' 'automount'
   option  'anon_mount'  '0' 
 
 ## btrfs is not picked up here
-#config 'mount'
-#  option 'label'        'sg-user'
-#  option 'target'       '/www/htdocs'
-#  option 'enabled'      '1' 
-#  option 'enabled_fsck' '0' 
-#  option 'options'      'noatime,nodiratime'
+config 'mount'
+  option 'label'        'Sg_storage'
+  option 'target'       '/www/htdocs'
+  option 'enabled'      '1' 
+  option 'enabled_fsck' '0' 
+  option 'options'      'rw,noatime,nodiratime'
 
 ## this is for vfat
 #config 'mount'

+ 5 - 2
openwrt/common/etc/crontabs/root

@@ -1,2 +1,5 @@
-1 6 * * *	/root/logrotate.sh /www/htdocs/logs/access.log; /root/logrotate.sh /www/htdocs/logs/error.log; /etc/init.d/lighttpd restart
-
+1 6 * * *	  /sbin/logrotate /www/htdocs/logs/access.log \
+                            /www/htdocs/logs/error.log \
+                            /www/htdocs/logs/post.log \
+                            /www/htdocs/logs/admin.log; \
+                            /etc/init.d/lighttpd restart

+ 13 - 10
openwrt/common/sbin/logrotate

@@ -3,25 +3,28 @@
 ## Simple logrotate script
 ## http://superglue.it | Danja Vasiliev, 2014
 ##
-## Takes filepath as argument
+## Takes filepath(s) as argument:
+## logrotate /www/access.log [/www/error.log] [/www/admin/admin.log]
 
 ## backlogs to keep
 _ROTATE=7
 _DATE=$(date +%d.%m.%y-%H:%M:%S)
-_FILE=$1
+_LOGS=( $* )
 
 function err {
   printf %s": "%s"\n" "$(basename $0)" "$1"; exit 1
 }
 
-[[ -z $1 ]] && err 'missing input file'
-[[ ! -e $1 ]] && err 'input file not readable'
+[[ -z $_LOGS ]] && err 'missing input file'
+[[ ! -e $_LOGS ]] && err 'input file not readable'
 
-## get number of backlogs and purge unwanted
-_N=( $(ls -1 -r $_FILE*.gz) ) 
-[[ ${#_N[@]} -gt $((_ROTATE-1)) ]] && rm -f ${_N[@]:$((_ROTATE-1)) }
-
-gzip -f $_FILE || err 'failed to gzip file'
-mv $_FILE.gz "$_FILE"_"$_DATE".gz || err 'failed to rename archive'
+for _FILE in ${_LOGS[@]}; do
+  ## get number of backlogs and purge unwanted
+  _N=( $(ls -1 -r $_FILE*.gz &>/dev/null || echo '') ) 
+  [[ ${#_N[@]} -gt $((_ROTATE-1)) ]] && rm -f ${_N[@]:$((_ROTATE-1)) }
+  ## compress and move
+  gzip -f $_FILE || err 'failed to gzip file'
+  mv $_FILE.gz "$_FILE"_"$_DATE".gz || err 'failed to rename archive'
+done
 
 exit 0

+ 5 - 6
openwrt/common/www/lib/admin/admin.sh

@@ -2,8 +2,8 @@
 
 _PWDFILE='/www/lib/admin/htpasswd'
 
-_TMP='/tmp'
-_LOG="${_TMP}/admin.log"
+_TMP='/www/htdocs/tmp'
+_LOG="/www/htdocs/logs/admin.log"
 
 _DEBUG=1
 
@@ -289,15 +289,14 @@ echo "<!doctype html>
 <html>
 <head><title>SuperGlue | Administration</title>
 $@
-<script type='text/javascript' src='/resources/default/js/jquery.js'></script>
 <style> 
 body { background:#ccc; color:#000; margin: 20px 0 0 200px; font-family: TitilliumWeb;}
 input { display: block; }
 .inline { display: inline; }
 img.logo { position: absolute; left:50px; top: 20px;}
 pre { white-space: pre-wrap; }
-@font-face { font-family: TitilliumWeb; src: url('/resources/default/fonts/Titillium_Web/TitilliumWeb-Regular.ttf') format('truetype'); }
-@font-face { font-family: TitilliumWeb; font-weight: bold; src: url('/resources/default/fonts/Titillium_Web/TitilliumWeb-Bold.ttf') format('truetype'); }
+@font-face { font-family: TitilliumWeb; src: url('/resources/fonts/Titillium_Web/TitilliumWeb-Regular.ttf') format('truetype'); }
+@font-face { font-family: TitilliumWeb; font-weight: bold; src: url('/resources/fonts/Titillium_Web/TitilliumWeb-Bold.ttf') format('truetype'); }
 </style>
 </head>"
 }
@@ -341,7 +340,7 @@ headerPrint 200
 ## html head
 htmlHead
 echo "<body>
-<img src='/resources/default/img/placeholder.png' class='logo'>
+<img src='/resources/img/superglueLogo.png' class='logo'>
 <hr>
 <h2 style='display:inline'>Superglue server control panel</h2>
 <span style='display:inline; margin-left: 50px;'>System version: "$(cat /etc/superglue_version || echo 'n/a')" | Device: "$(cat /etc/superglue_model || echo 'n/a')" | OpenWRT: "$(cat /etc/openwrt_version || echo 'n/a')"</span>

+ 2 - 2
openwrt/common/www/lib/cgi/post.sh

@@ -20,8 +20,8 @@ set -o noglob
 ## some path variables
 _WWW='/www'
 _HTDOCS="${_WWW}/htdocs"
-_TMP="/tmp"
-_LOG="${_TMP}/post.log"
+_TMP="${_HTDOCS}/tmp"
+_LOG="${_HTDOCS}/logs/post.log"
 
 ## _DEBUG=0 no logging at all
 ## _DEBUG=1 writes to $_LOG file

+ 1 - 1
openwrt/sg_0.1.revision

@@ -1 +1 @@
-4
+6