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
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