diff options
author | 2013-05-03 01:02:38 -0400 | |
---|---|---|
committer | 2013-05-03 01:02:38 -0400 | |
commit | 02cd02efb64d4971da4f919a12572fda63aba74c (patch) | |
tree | b723539da0411d4e96fe94c0af73910fb0a73979 | |
parent | 5d16bf61c0f93583b033779f337534f0f822e58a (diff) |
ensure HOME exists
The SD card could be replaced, or it got deleted some other way. Still let
git-annex start, and ensure anything that wants to write to HOME can.
-rwxr-xr-x | standalone/android/runshell | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/standalone/android/runshell b/standalone/android/runshell index ba8395778..0aa531433 100755 --- a/standalone/android/runshell +++ b/standalone/android/runshell @@ -101,10 +101,15 @@ run () { shift 1 exec "$cmd" "$@" else - # As good a start point as any. - if $cmd test -d "$HOME"; then - cd "$HOME" + # Ensure home directory exists, even if it got deleted + # somehow. + if ! $cmd mkdir -p "$HOME"; then + $cmd echo "mkdir of $HOME failed!" fi + + # As good a start point as any. + cd "$HOME" + $cmd echo "Starting webapp ..." $cmd nohup git annex webapp >/dev/null & /system/bin/sh |