From 921d04501fda6653af189dc90e1ef1d1a5b127f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 May 2013 01:02:38 -0400 Subject: [PATCH] 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. --- standalone/android/runshell | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/standalone/android/runshell b/standalone/android/runshell index ba8395778b..0aa531433c 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