Map-A-Droid/MAD-ATV

16mad: check directory with -e

Closed this issue · 3 comments

MAD-ATV/16mad

Line 32 in b7a7d7d

if [ ! -f /system/priv-app/RemoteGpsController.apk ]; then

/system/priv-app/RemoteGpsController.apk/ is a directory and need the -e flag to test for existence. In the current version the check always fails (because -f is used, but its not a file).
The condition is always true and the init script try to reinstall PD.

Bug 2 (download function):
I found this by debugging the new download function (since v1.2.0). For me the new download function never finishes.
changed it to this below to make it work again:

# $1 = url
# $2 = local path
# lets see that curl exits successfully
/system/bin/curl --retry 999 --retry-max-time 0 -s -k -L -A "$useragent" -o "$2" "$1"
echo
}

Not a directory here, doesn't really make sense, however maybe krz made an oopsie with new ROM images?

krzee commented

it should be a directory, i forgot that its a dir from the commandline perspective... but this has nothing to do with the new rom, its been there from the start.

As for the curl thing, I want to know why the command I gave was not working for you. It worked everywhere I tested it.

krzee commented

lol i must have been thinking about osx apps, apk's are zip format not a dir...
he also says it keeps trying to install PD, which would only happen if it hasnt been installed, as there is another check there for PD.

atvX_s905w:/system/priv-app # [[ -f RemoteGpsController.apk ]] && echo yes || echo no
yes
atvX_s905w:/system/priv-app # [ ! -f /system/priv-app/RemoteGpsController.apk ] && echo yes || echo no
no