How about this?
--- a/wbar_update.sh
+++ b/wbar_update.sh
@@ -1,9 +1,11 @@
-#!/bin/sh
+#!/bin/busybox ash
# (c) Robert Shingledecker 2010
# Called from desktop.sh to update wbar icons.
+. /etc/init.d/tc-functions
+useBusybox
writeWBARitem() {
-busybox awk -v output="$TMP" -v target="$TARGET" -v wbaricons="$TCEWBAR" '
+awk -v output="$TMP" -v target="$TARGET" -v wbaricons="$TCEWBAR" '
BEGIN {
FS = "="
name = ""
@@ -19,7 +21,7 @@
test = match(exec,"%")
if ( test ) exec = substr(exec,0,test-1)
} else if ( $1 == "X-FullPathIcon" ) {
- icon = $2
+ icon = rtrim($2)
} else if ( $1 == "Terminal" ) {
terminal = $2
}
@@ -72,6 +74,7 @@
FREEDESK=/usr/local/share/applications/"$APPNAME".desktop
if [ -e "$FREEDESK" ]; then
ICONCHECK="$(awk 'BEGIN{FS = "="}$1=="X-FullPathIcon"{print $2}' "$FREEDESK")"
+ ICONCHECK=$(trim "$ICONCHECK")
NAMECHECK="$(awk 'BEGIN{FS = "="}$1=="Name"{print $2; exit 0}' "$FREEDESK")"
if grep -qw "^t: *${NAMECHECK// /}$" "${TCEDIR}"/xwbar.lst 2>/dev/null; then exit 0; fi
TARGET="$APPNAME".img