mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-25 05:30:23 +00:00
Prevent accidentally mounting home folder as DATA_DIR
This commit is contained in:
parent
cad1be950b
commit
99ed97836f
1 changed files with 7 additions and 0 deletions
|
@ -58,6 +58,13 @@ groupmod -o -g "${PGID:-$DETECTED_PGID}" "$ARCHIVEBOX_USER" > /dev/null 2>&1
|
||||||
export PUID="$(id -u archivebox)"
|
export PUID="$(id -u archivebox)"
|
||||||
export PGID="$(id -g archivebox)"
|
export PGID="$(id -g archivebox)"
|
||||||
|
|
||||||
|
# Check if user attempted to run it in the root of their home folder or hard drive (common mistake)
|
||||||
|
if [[ -d "$DATA_DIR/Documents" || -d "$DATA_DIR/.config" || -d "$DATA_DIR/usr" ]]; then
|
||||||
|
echo -e "\n[X] ERROR: ArchiveBox was run from inside a home folder"
|
||||||
|
echo -e " Make sure you are inside an existing collection directory or a new empty directory and try again"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
# Check the permissions of the data dir (or create if it doesn't exist)
|
# Check the permissions of the data dir (or create if it doesn't exist)
|
||||||
if [[ -d "$DATA_DIR/archive" ]]; then
|
if [[ -d "$DATA_DIR/archive" ]]; then
|
||||||
if touch "$DATA_DIR/archive/.permissions_test_safe_to_delete" 2>/dev/null; then
|
if touch "$DATA_DIR/archive/.permissions_test_safe_to_delete" 2>/dev/null; then
|
||||||
|
|
Loading…
Reference in a new issue