diff --git a/scripts/beesd b/scripts/beesd index 05f5c2f..f2185b1 100755 --- a/scripts/beesd +++ b/scripts/beesd @@ -4,6 +4,7 @@ ## Helpful functions INFO(){ echo "INFO:" "$@"; } ERRO(){ echo "ERROR:" "$@"; exit 1; } +YN(){ [[ "$1" =~ (1|Y|y) ]]; } ## Global vars export BEESHOME BEESSTATUS @@ -48,6 +49,7 @@ MNT_DIR="${MNT_DIR:-$WORK_DIR/mnt/$UUID}" BEESHOME="${BEESHOME:-$MNT_DIR/.beeshome}" BEESSTATUS="${BEESSTATUS:-$WORK_DIR/$UUID.status}" DB_SIZE="${DB_SIZE:-$((64*AL16M))}" +LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}" INFO "Check: BTRFS UUID exists" if [ ! -d "/sys/fs/btrfs/$UUID" ]; then @@ -95,5 +97,10 @@ fi chmod 700 "$DB_PATH" } -bees $MNT_DIR +if YN "$LOG_SHORT_PATH"; then + cd "$MNT_DIR" || exit 1 + bees . +else + bees "$MNT_DIR" +fi exit 0 diff --git a/scripts/beesd.conf.sample b/scripts/beesd.conf.sample index 29bdda4..c41e275 100644 --- a/scripts/beesd.conf.sample +++ b/scripts/beesd.conf.sample @@ -12,6 +12,9 @@ UUID=5d3c0ad5-bedf-463d-8235-b4d4f6f99476 # BEESHOME="$MNT_DIR/.beeshome" # BEESSTATUS="$WORK_DIR/$UUID.status" +## Make path shorter in logs +# LOG_SHORT_PATH=N + ## Bees DB size # Hash Table Sizing # sHash table entries are 16 bytes each