Danja Vasiliev vor 10 Jahren
Ursprung
Commit
6d9eebfcc5

+ 1 - 1
openwrt-rescue/sg_0.1.revision

@@ -1 +1 @@
-8
+9

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

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

+ 4 - 3
openwrt/common/etc/lighttpd/lighttpd.conf

@@ -69,13 +69,14 @@ $HTTP["request-method"] == "GET" {
     "^/resources/(.*)$" =>  "resources/$1",
     "^/devTools/(.*)$"  =>  "devTools/$1",
     "^/templates/(.*)$" =>  "templates/$1",
+    "^/extension" =>  "extension.crx",
   ),
   alias.url = (
     "/resources"  =>  "/opt/lib/resources",
     "/devTools"   =>  "/opt/lib/devTools",
-    "/extension"  =>  "/opt/lib/extension",
+    "/extension.crx"  =>  "/www/extension/chromium.crx",
     "/templates"  =>  "/opt/lib/templates",
-    "/admin"      =>  "/opt/lib/cgi/admin.cgi"
+    "/admin"      =>  "/opt/lib/cgi/admin2.cgi"
   )
   ## override content and mime type for dotless files to text/html
   $HTTP["url"] !~ "(\.)" {
@@ -88,7 +89,7 @@ $HTTP["request-method"] == "GET" {
 
 $HTTP["request-method"] == "POST" {
   alias.url = (
-    "/admin"    =>  "/opt/lib/cgi/admin.cgi",
+    "/admin"    =>  "/opt/lib/cgi/admin2.cgi",
     ""          =>  "/opt/lib/cgi/post.cgi"
   )
   auth.require = (

+ 188 - 97
openwrt/common/opt/lib/cgi/admin2.cgi

@@ -37,16 +37,46 @@ headerPrint() {
   printf '%b' 'Content-Type: text/html\r\n\r\n';
 }
 
+## faster echo
+_echo() {
+  printf "%s" "${*}"
+}
+
 htDigest() {
   _USER='admin'
   _PWD=$1
   _REALM='superglue'
   _HASH=$(echo -n "$_USER:$_REALM:$_PWD" | md5sum | cut -b -32)
-  echo -n "$_USER:$_REALM:$_HASH"
+  printf "%s" "$_USER:$_REALM:$_HASH"
+}
+
+urlDec() {
+  local value=${*//+/%20}
+  for part in ${value//%/ \\x}; do
+    printf "%b%s" "${part:0:4}" "${part:4}"
+  done
 }
 
 setQueryVars() {
-  env
+  _VARS=( ${!POST_*} )
+#  local v
+#  for v in ${_VARS[@]}; do
+  #  echo $v
+#    v=$(urlDec "${v}")
+#    eval "_${v//POST_/}=${!v}"; 
+#  done
+  local v
+  for v in ${_VARS[@]}; do
+    logThis "$v=${!v}"
+  done
+  #echo $POST_lanssid
+  #env
+}
+
+runSuid() {
+  local _SID=$(/usr/bin/ps -p $$ -o sid=)  ## pass session id to the child
+  local _CMD=$@
+  sudo ./suid.sh $_CMD $_SID 2>/dev/null
 }
 
 getQueryFile() {
@@ -73,18 +103,18 @@ validIp() {
 }
 
 pwdChange() {
-  if [[ ! -z "${_pwd##$_pwdd}" ]]; then 
+  if [[ ! -z "${POST_pwd##$POST_pwdd}" ]]; then 
     _ERR=1
     showMesg 'Passwords did not match'
   fi
 
-  if [[ ${#_pwd} -lt 6 ]]; then
+  if [[ ${#POST_pwd} -lt 6 ]]; then
     _ERR=1
     showMesg 'Password must be at least 6 characters long'
   fi
 
-  runSuid "echo -e \"$_pwd\n$_pwd\" | passwd root"
-  runSuid "echo $(htDigest $_pwd) > $_PWDFILE"
+  runSuid "echo -e \"$POST_pwd\n$POST_pwd\" | passwd root"
+  runSuid "echo $(htDigest $POST_pwd) > $_PWDFILE"
   _ERR=$?
   if [[ $_ERR -gt 0 ]]; then
     showMesg 'Password change failed'
@@ -94,9 +124,9 @@ pwdChange() {
 }
 
 lanAddr() {
-  logThis "new LAN addr is: $_laddr"
-  validIp $_laddr || showMesg 'Not valid network address'
-  doUci set laddr $_laddr
+  logThis "new LAN addr is: $POST_laddr"
+  validIp $POST_laddr || showMesg 'Not valid network address'
+  doUci set laddr $POST_laddr
   _ERR=$?
   if [[ $_ERR -gt 0 ]]; then
     showMesg 'Setting network address failed'
@@ -107,7 +137,7 @@ lanAddr() {
 }
 
 wanSet() {
-  if [[ ! -z $_wanifname ]]; then
+  if [[ ! -z $POST_wanifname ]]; then
     ## eth and wlan wan cases are different!
     ## eth wan requires:
     ##   config interface 'wan'
@@ -126,23 +156,23 @@ wanSet() {
     ##    config wifi-iface 
     ##      option device 'radio0'
     ##      option network 'wan'
-    logThis "wan.ifname=$_wanifname"
-    if [[ $_wanifname == 'eth0' ]]; then
-      doUci set wanifname $_wanifname
+    logThis "wan.ifname=$POST_wanifname"
+    if [[ $POST_wanifname == 'eth0' ]]; then
+      doUci set wanifname $POST_wanifname
       doUci set wanwifacedis '1'
-    elif [[ $_wanifname == 'wlan1' ]]; then
+    elif [[ $POST_wanifname == 'wlan1' ]]; then
       doUci set wanifname ''
       doUci set wanwifacedis ''
     fi
-    if [[ $_wanproto == 'dhcp' ]]; then
+    if [[ $POST_wanproto == 'dhcp' ]]; then
       doUci set wanproto dhcp
-    elif [[ $_wanproto == 'static' ]]; then
-      logThis "wan.ipaddr=$_wanipaddr"
+    elif [[ $POST_wanproto == 'static' ]]; then
+      logThis "wan.ipaddr=$POST_wanipaddr"
       doUci set wanproto static
-      doUci set wanipaddr $_wanipaddr
-      doUci set wannetmask $_wannetmask
+      doUci set wanipaddr $POST_wanipaddr
+      doUci set wannetmask $POST_wannetmask
     fi
-    if [[ $_wanifname == 'wlan1' ]]; then
+    if [[ $POST_wanifname == 'wlan1' ]]; then
       ssidChange || showMesg 'Wireless changes failed'
     fi
     ## background the following
@@ -150,30 +180,30 @@ wanSet() {
     showMesg 'Internet connection is configured' 'Waiting for device to get ready' ||
     showMesg 'Configuring Internet connection failed'
   fi
-  logThis "new WAN iface is: $_wanifname"
+  logThis "new WAN iface is: $POST_wanifname"
 }
 
 ssidChange() {
   ## check for iface
-  [[ ! $_iface =~ ^('wan'|'lan')$ ]] && showMesg 'Error changing wireless settings' 'unknown/unconfigured interface'
-  logThis "$_iface is being set"
+  [[ ! $POST_iface =~ ^('wan'|'lan')$ ]] && showMesg 'Error changing wireless settings' 'unknown/unconfigured interface'
+  logThis "$POST_iface is being set"
 
-  _p=$_iface
+  _p=$POST_iface
 
   ## default enc for now
   local _enc='psk2'
-  if [[ $_iface == 'wan' ]]; then
+  if [[ $POST_iface == 'wan' ]]; then
     local _mode='sta'
-    local _ssid="${_wanssid}"
-    local _key="${_wankey}"
+    local _ssid="${POST_wanssid}"
+    local _key="${POST_wankey}"
   else 
     local _mode='ap'
-    local _ssid="${_lanssid}"
-    local _key="${_lankey}"
+    local _ssid="${POST_lanssid}"
+    local _key="${POST_lankey}"
   fi
 
   logThis "ssid: $_ssid [$_mode], key: $_key [$_enc]"
-  logThis $_wanssid
+  logThis $POST_wanssid
 
   if [[ ${#_ssid} -lt 4 ]]; then
    _ERR=1
@@ -221,14 +251,23 @@ showMesg() {
     headerPrint 200
   fi
   htmlHead "<meta http-equiv='refresh' content='3;url=${HTTP_REFERER}'>"
-  echo "<body>
-<h1>SG</h1>
-<hr>
-<h2 style='display:inline'>$_TYPE $_MSG</h2>
-<span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>
-<hr>
-</body></html>"
+  _echo "<body>
+  <h1>Superglue server control panel</h1>
+  <img src='http://"${HTTP_HOST}"/resources/img/superglueLogo.png' class='logo'>"
+  _echo "<hr>
+  <h2 style='display:inline'>$_TYPE $_MSG</h2>
+  <span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>
+  <hr>"
+  footerBody
   exit 0
+#  _echo "<body>
+#<h1>SG</h1>
+#<hr>
+#<h2 style='display:inline'>$_TYPE $_MSG</h2>
+#<span style='display:inline; margin-left: 50px;'>$_SUBMSG</span>
+#<hr>
+#</body></html>"
+#  exit 0
 }
 
 updateFw() {
@@ -330,20 +369,48 @@ getStat() {
   logThis $IP4
 }
 
+## call with argument to inject additional lines
+## ie: htmlhead "<meta http-equiv='refresh' content='2;URL=http://${HTTP_REFERER}'>"
+
 htmlHead() {
-echo "<!-- obnoxious code below, keep your ports tight -->
+_echo "<!-- obnoxious code below, keep your ports tight -->
 <!doctype html>
 <html>
-<head><title>SuperGlue | Administration</title>
-$@
+<head>
+<link rel='icon' href='http://${HTTP_HOST}/resources/img/favicon.ico' type='image/x-icon'>
+<title>Superglue server | Control panel</title>
 <link rel='stylesheet' type='text/css' href='http://${HTTP_HOST}/resources/admin/admin.css'>
+$@
 </head>"
 }
-%>
 
-<% headerPrint '200' %>
+footerBody() {
+_echo "</body>
+<script type='text/javascript' src='http://${HTTP_HOST}/resources/admin/admin.js'></script>
+</html>"
+}
 
-<%
+if [[ "${REQUEST_METHOD^^}" == "POST" ]]; then
+  [[ $CONTENT_LENGTH -gt 0 ]] || err 'content length is zero, 301 back to referer' '301'
+  case "${CONTENT_TYPE^^}" in 
+    APPLICATION/X-WWW-FORM-URLENCODED*) setQueryVars;;
+                  MULTIPART/FORM-DATA*) getQueryFile;;
+                                     *) _ERR=1; _OUT='this is not a post';;
+  esac
+
+  case $REQUEST_URI in
+                *pwdchange) pwdChange;;
+               *ssidchange) ssidChange;;
+                  *lanaddr) lanAddr;;
+                 *updatefw) updateFw;;
+                *rebootnow) rebootNow;;
+                      *wan) wanSet;;
+                         *) logThis 'bad action'; headerPrint 405; 
+                            echo 'no such thing'; exit 1;;
+  esac
+fi
+
+headerPrint '200'
 ## html head
 htmlHead
 
@@ -357,100 +424,124 @@ wannetmask=$(doUci get wannetmask)
 wanssid=$(doUci get wanssid)
 wankey=$(doUci get wankey)
 
-echo "<body>
-<h1>SG</h1>
-<hr>
-<h2 style='display:inline'>Superglue server control panel</h2>
-<span style='display:block;'>System version: $sgver | Device: $devmod | OpenWRT: $openwrt</span>
-<span style='display:block;'>$(uptime)</span>
-<hr>
+ipaddr="$(ifconfig $wanifname | sed -n '/dr:/{;s/.*dr://;s/ .*//;p;}')"
+%>
 
-Update firmware:
-<form method='post' action='/admin/updatefw' enctype='multipart/form-data'>
-<div id='uploadbox'>
-<input id='uploadfile' placeholder='Choose file' disabled='disabled'>
-<input id='uploadbtn' name='fwupload' type='file'>
-</div>
-<input type='submit' value='Upload'>
-</form>
+<body>
+  <h1>Superglue server control panel</h1>
+  <img src='http://<% _echo "${HTTP_HOST}" %>/resources/img/superglueLogo.png' class='logo'>
 
-<hr>
+<section class='inert'>
+  <span style='display:block;'><% printf "System version: %s | Device: %s | OpenWRT: %s" "$sgver" "$devmod" "$openwrt" %></span>
+  <span style='display:block;'><% uptime %></span>
+</section>
 
-Internet connection:
-<form method='post' action='/admin/wan' name='wan' onchange='formChange();'>
+<section>
+  <h2>Internet connection: <% _echo $ipaddr %></h3>
+  <form method='post' action='/admin/wan' name='wan' id='wanconf'> <!-- onchange='formChange();' -->
   <div style='display:inline-flex'>
   <div style='display:inline-block;'>
   <select name='wanifname' id='wanifname' style='display:block'>
-  <option value='eth0' id='eth' $([[ $wanifname =~ ('eth') ]] && echo 'selected')>Wired (WAN port)</option>
-  <option value='wlan1' id='wlan' $([[ $wanifname =~ ('wlan') ]] && echo 'selected')>Wireless (Wi-Fi)</option>
+  <option value='eth0' id='eth' <% ( [[ $wanifname =~ ('eth') ]] && _echo 'selected' ) %> >Wired (WAN port)</option>
+  <option value='wlan1' id='wlan' <% ( [[ $wanifname =~ ('wlan') ]] && _echo 'selected' ) %> >Wireless (Wi-Fi)</option>
   </select>
   <fieldset id='wanwifi' class='hide'>
-  <input type='text' name='wanssid' value='$wanssid'>
-  <input type='password' name='wankey' value='$wankey'>
+  <input type='text' name='wanssid' value='<% _echo $wanssid %>'>
+  <input type='password' name='wankey' value='<% _echo $wankey %>'>
   </fieldset>
+  <span class='help'>help</span>
   </div>
 
   <div style='display:inline-block;'>
   <select name='wanproto' id='wanproto' style='display:block'>
-  <option value='dhcp' name='dhcp' id='dhcp' $([[ $wanproto == 'dhcp' ]] && echo 'selected')>Automatic (DHCP)</option>
-  <option value='stat' name='dhcp' id='stat' $([[ $wanproto == 'static' ]] && echo 'selected')>Manual (Static IP)</option>
+  <option value='dhcp' name='dhcp' id='dhcp' <% ([[ $wanproto == 'dhcp' ]] && _echo 'selected') %>>Automatic (DHCP)</option>
+  <option value='stat' name='dhcp' id='stat' <% ([[ $wanproto == 'static' ]] && _echo 'selected') %>>Manual (Static IP)</option>
   </select>
   <fieldset id='wanaddr' class='hide' >
-  <input type='text' name='wanipaddr' id='wanipaddr' value='$wanipaddr'>
-  <input type='text' name='wangw' id='wannetmask' value='$wannetmask'>
+  <input type='text' name='wanipaddr' id='wanipaddr' value='<% _echo $wanipaddr %>'>
+  <input type='text' name='wangw' id='wannetmask' value='<% _echo $wannetmask %>'>
   </fieldset>
   </div>
   </div>
   <input type='hidden' name='iface' value='wan' class='inline'>
   <input type='submit' value='Apply'>
+  </form>
+  <span class='help'>help</span>
+</section>
 
-</form>
-<hr>
-
-Local wireless network:
+<section>
+<h2>Local wireless network:</h2>
 <form method='post' action='/admin/ssidchange'>
   <div style='display:inline-flex'>
   <div style='display:inline-block;'>
-    <input type='text' name='lanssid' value='$(doUci get lanssid)'>
-    <input type='password' name='lankey' value='$(doUci get lankey)'>
+    <input type='text' name='lanssid' value='<% doUci get lanssid %>'>
+    <input type='password' name='lankey' value='<% doUci get lankey %>'>
   </div>
   <div style='display:inline-block;'>
-    <input type='text' name='lanipaddr' value='$(doUci get lanipaddr)'>
+    <input type='text' name='lanipaddr' value='<% doUci get lanipaddr %>'>
     <input type='hidden' name='iface' value='lan' class='inline'>
   </div>
   </div>
-  <input type='submit' value='Apply'>
-  
+    <input type='submit' value='Apply'>  
 </form>
+  <span class='help'>help</span>
+</section>
 
-<hr>
-
-<form action='/admin/rebootnow' method='post' class='inline'>
-<input type='hidden' name='reboot' value='now' class='inline'>
-<input type='submit' value='Reboot' class='inline'>
+<section>
+<h2>Change password:</h2>
+<form method='post' action='/admin/pwdchange'>
+  <div style='display:inline-flex'>
+  <div style='display:inline-block;'>
+    <input type='text' name='usr' value='admin' readonly>
+  </div>
+  <div style='display:inline-block;'>
+    <input type='password' name='pwd' value=''>
+    <input type='password' name='pwdd' value=''>
+  </div>
+  </div>
+    <input type='submit' value='Apply'>
 </form>
+<span class='help'>help</span>
+</section>
 
-<form action='http://logout@${HTTP_HOST}/admin' method='get' class='inline'>
-<input type='submit' value='Logout' class='inline'>
-</form>
 
+<section>
+  <h2>Update firmware:</h2>
+  <form method='post' action='/admin/updatefw' enctype='multipart/form-data'>
+  <div id='uploadbox'>
+    <input id='uploadfile' placeholder='Choose file' disabled='disabled'>
+    <input id='uploadbtn' name='fwupload' type='file'>
+  </div>
+    <input type='submit' value='Upload'>
+  </form>
+  <span class='help'>help</span>
+</section>
+
+<section>
+  <h2></h2>
+  <form action='/admin/rebootnow' method='post' class='inline'>
+    <input type='hidden' name='reboot' value='now' class='inline'>
+    <input type='submit' value='Reboot' class='inline'>
+  </form>
+
+  <form action='http://logout@<% _echo ${HTTP_HOST} %>/admin' method='get' class='inline'>
+    <input type='submit' value='Logout' class='inline'>
+  </form>
+</section>
+
+<div style='height:200px'></div>
 <hr>
 Memory:
-<pre>$(free)</pre>
+<pre><% free %></pre>
 <hr>
 Storage:
-<pre>$(df -h)</pre>
+<pre><% df -h %></pre>
 <hr>
 Environment:
-<pre>$(env)</pre>
+<pre><% env %></pre>
 <hr>
 
-</body>
-<script type='text/javascript' src='http://${HTTP_HOST}/resources/admin/admin.js'></script>
-
-</html>"
-
-
+<%
+footerBody
+exit 0
 %>
-
-

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
openwrt/common/opt/lib/devTools/ace/worker-javascript.js.bak


+ 86 - 4
openwrt/common/opt/lib/resources/admin/admin.css

@@ -1,12 +1,14 @@
 html {
-  width: 1000px;
+  /* width: 1000px; */
+  max-width: 1000px;
 } 
 body { 
-  background:#ccc;
+  background:#b9bbc0;
   color:#0c0c0c;
   margin: 20px 0 0 200px;
   font-family: TitilliumWeb;
   font-size: 100%;
+  cursor: default;
 }
 
 input, select {
@@ -84,28 +86,108 @@ input[type='file'] {
 img.logo {
   position: absolute;
   left:50px;
-  top: 20px;
+  top: 34px;
 }
+
 hr {
+  margin-top: 1em;
   border: 0;
   height: 1px;
-  background: #aaa 
+  background: #999;
 }
+
 pre {
   white-space: pre-wrap;
 }
+
 fieldset {
   border: 0;
   margin: 0;
   padding: 0; 
 }
+
+h1 {
+  margin: 0.67em auto;
+}
+
+h2 {
+  /* margin: 0.67em auto; */
+  /* margin: 0.4em auto 0.1em; */
+  margin: 0;
+  padding: 0.2em 0 0.1em;
+}
+
+section {
+  border-bottom: solid 1px #999;
+  padding-bottom: 1em;
+  padding-left: 0.8em;
+  position: relative;
+}
+
+section:not(.inert):hover {
+  background-color: #c7cacf;
+  opacity: 1;
+  transition: all 0.5s ease;
+}
+
+span.help {
+  position: relative;
+  visibility: hidden;
+  opacity: 0;
+  font-size: smaller;
+  line-height: 1.3em;
+  position: absolute;
+  top: 0;
+  right: 0;
+  margin: 0.1em 0.5em;
+  cursor: help;
+  border-bottom: dotted 1px #000;
+}
+
+section:not(.inert):hover span.help {
+  visibility: visible;
+  opacity: 0.6;
+  transition: all 1s ease-in;
+}
+
+span.help::after{
+  display:block;
+  position: absolute;
+  top: -1.7em;
+  right: -2px;
+  background-color: #fff;
+  border: solid 1px #777;
+  opacity: 0;
+  font-size: smaller;
+  padding: 0.1em 1em;
+  max-width: 200px;
+  white-space: pre;
+}
+
+span.help:hover::after,
+span.help:active::after 
+{
+  content: 'coming soon..';
+  opacity: 1;
+  display: block;
+} 
+
 .inline {
   display: inline;
 }
+.block {
+  display: block;
+}
+
+.inline-block {
+  display: inline-block;
+}
+
 .hide {
   visibility: hidden;
   display: none;
 }
+
 .show {
   visibility: visible;
   display: inline-block;

+ 44 - 9
openwrt/common/opt/lib/resources/admin/admin.js

@@ -1,13 +1,49 @@
 (function() {
-  document.getElementById('uploadbtn').onchange = function () {
-    document.getElementById('uploadfile').value = this.value.replace(/^.*\\/, "");
-    var len = document.getElementById('uploadfile').value.length - 7;
-    document.getElementById('uploadfile').setAttribute('size', len);
-    var len = document.getElementById('uploadfile').offsetWidth;
-    document.getElementById('uploadbtn').style.width = len + "px";
-  };
+
+/*
+ * seems like there is not need to use getElementById
+ * and instead access elements directly by their id
+ */
+
+//  var uploadbtn = document.getElementById('uploadbtn');
+//  var uploadfile = document.getElementById('uploadfile')
+  uploadbtn.addEventListener('change', function () {
+    uploadfile.value = this.value.replace(/^.*\\/, "");
+    var len = uploadfile.value.length - 7;
+    uploadfile.setAttribute('size', len);
+    var len = uploadfile.offsetWidth;
+    uploadbtn.style.width = len + "px";
+  });
+
+  var selects = wan.getElementsByTagName('select');
+  for (i = 0; i < selects.length; i++) { 
+    wanChange(selects[i]);
+  }
+
+  wanconf.addEventListener('change', function() { wanChange(event.target) });
+
+  function wanChange(e) {
+  //  var wanwifi = document.getElementById('wanwifi');
+  //  var wanaddr = document.getElementById('wanaddr');
+    switch (e[e.selectedIndex].id) {
+      case 'wlan':
+        wanwifi.setAttribute('class','show');
+        break;
+      case 'dhcp':
+        wanaddr.setAttribute('class','hide');
+        break;
+      case 'eth':
+        wanwifi.setAttribute('class','hide');
+        break
+      case 'stat':
+        wanaddr.setAttribute('class','show');
+        break;
+    }
+  }
+
 })();
 
+/*
 function formChange() {
   if (document.activeElement.tagName.toLowerCase() !=  'select') {
     console.log('not select');
@@ -30,5 +66,4 @@ function formChange() {
     document.getElementById('wanwifi').setAttribute('class','hide');
   }
 };
-
-
+*/

+ 13 - 4
openwrt/make_fw.sh

@@ -53,6 +53,9 @@ for _TARGET in $_TARGETS; do
   cp -Ra $_COMMON $_TARGET.tmp
   cp -Ra $_TARGET/* $_TARGET.tmp/
 
+  echo 'cleaning temporary files'
+  find . -name '*.swp' -o -name '*.swo' -o -name '*.tmp' -o -name '*.bup' -o -name '*.bak' -exec rm -rf {} \;
+
   sed -e "s/%REVISION%/$_OPENWRT/g" -e "s/%VERSION%/$_VERSION/g" $_COMMON/etc/banner > $_TARGET.tmp/etc/banner
 
   echo $_VERSION > $_TARGET.tmp/etc/superglue_version
@@ -93,10 +96,16 @@ if [[ $_ERR -eq 0 ]]; then
   [[ -e $_BUILDS/latest ]] && touch $_BUILDS/latest || mkdir $_BUILDS/latest 
   for _TARGET in $_TARGETS; do
     [[ -e $_BUILDS/latest/$_TARGET ]] && rm -f $_BUILDS/latest/$_TARGET/* || mkdir $_BUILDS/latest/$_TARGET
-    set -o xtrace
-    ln -sf $_BUILDS/$_VERSION/$_TARGET/superglue-firmware-*-factory.bin $_BUILDS/latest/$_TARGET/superglue-firmware-latest-$(echo $_TARGET | tr [:upper:] [:lower:])-factory.bin
-    ln -sf $_BUILDS/$_VERSION/$_TARGET/superglue-firmware-*-sysupgrade.bin $_BUILDS/latest/$_TARGET/superglue-firmware-latest-$(echo $_TARGET | tr [:upper:] [:lower:])-sysupgrade.bin
-    set +o xtrace
+    #set -o xtrace
+    _FACTORY="$_BUILDS"/latest/"$_TARGET"/superglue-firmware-$(echo "$_TARGET" | tr [:upper:] [:lower:])-"${_VERSION}"-factory.bin
+    _SYSUPGRADE=$_BUILDS/latest/"$_TARGET"/superglue-firmware-$(echo "$_TARGET" | tr [:upper:] [:lower:])-"${_VERSION}"-sysupgrade.bin
+
+    ln -sf $_BUILDS/$_VERSION/$_TARGET/superglue-firmware-*-factory.bin $_FACTORY &&
+      echo -e "$_FACTORY\n"
+    ln -sf $_BUILDS/$_VERSION/$_TARGET/superglue-firmware-*-sysupgrade.bin $_SYSUPGRADE &&
+      echo -e "$_SYSUPGRADE\n"
+
+    # set +o xtrace
   done
 
 else

+ 1 - 1
openwrt/sg_0.1.revision

@@ -1 +1 @@
-29
+36

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.