[parser] [cmd_fsck] Added fsck command to check integrity of db file

This commit is contained in:
ayakael 2018-04-07 20:08:23 -04:00
parent 1fc797418e
commit 1e2d22cfbb
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
2 changed files with 27 additions and 0 deletions

22
src/cmd_fsck Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# doc cmd_fsck {
#
# DESCRIPTION
# cmd_fsck - Does series of tests on target's database file
#
# USAGE
# cmd_fsck </path/to/git/dir> </path/to/target/dir>
#
# }
cmd_fsck() {
local GIT_DIR="${1}"
local TARGET="${2}"
local DB_FILE="${TARGET}/${_OPT_DB_FILE}"
chk_deployed_ids "${TARGET}" "${DB_FILE}"
chk_nonexistent_ids "${TARGET}" "${DB_FILE}"
chk_metadata "${GIT_DIR}" "${TARGET}" "${DB_FILE}"
}

View file

@ -29,5 +29,10 @@ case "${1}" in
shift
cmd_du "${@}"
;;
fsck)
shift
cmd_fsck "${@}"
;;
esac