add func file_size + del unused func
This commit is contained in:
parent
cecbdd9050
commit
7931150ca2
@ -142,15 +142,12 @@ function db_query() {
|
||||
echo $@ | mysql $args
|
||||
}
|
||||
|
||||
# db_exist_md5 <md5> -> true/false 0/1
|
||||
function db_exist_md5() {
|
||||
result=($(db_query "SELECT COUNT(md5) FROM File WHERE File.MD5 LIKE '$1';"))
|
||||
if [ "${result[2]}" -gt "0" ]; then
|
||||
echo true
|
||||
return $TRUE
|
||||
# file_size <path> -> (du -b)/1024 [Kb]
|
||||
function file_size() {
|
||||
if [ -f "$1" ]; then
|
||||
echo $(($(du -b "$1" | cut -f 1)/1024))
|
||||
else
|
||||
echo false
|
||||
return $FALSE
|
||||
echo 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user