From 02cd02efb64d4971da4f919a12572fda63aba74c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 May 2013 01:02:38 -0400 Subject: 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(-) (limited to 'standalone/android/runshell') 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 -- cgit v1.2.3