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.
This commit is contained in:
Joey Hess 2013-05-03 01:02:38 -04:00
parent b3a3273741
commit 921d04501f

View file

@ -101,10 +101,15 @@ run () {
shift 1 shift 1
exec "$cmd" "$@" exec "$cmd" "$@"
else else
# As good a start point as any. # Ensure home directory exists, even if it got deleted
if $cmd test -d "$HOME"; then # somehow.
cd "$HOME" if ! $cmd mkdir -p "$HOME"; then
$cmd echo "mkdir of $HOME failed!"
fi fi
# As good a start point as any.
cd "$HOME"
$cmd echo "Starting webapp ..." $cmd echo "Starting webapp ..."
$cmd nohup git annex webapp >/dev/null & $cmd nohup git annex webapp >/dev/null &
/system/bin/sh /system/bin/sh