36 lines
500 B
Bash
36 lines
500 B
Bash
#!/bin/bash
|
|
|
|
BINARY="/opt/two/bin/db"
|
|
|
|
function use_db {
|
|
db_use="${1}"
|
|
shift 1
|
|
|
|
${BINARY} "${db_use}" "$@"
|
|
return $?
|
|
}
|
|
|
|
function check_in_db {
|
|
use_db "check_in_db" "$@"
|
|
return $?
|
|
}
|
|
|
|
function add_in_db {
|
|
use_db "add_in_db" "$@"
|
|
return $?
|
|
}
|
|
|
|
function delete_in_db {
|
|
use_db "delete_in_db" "$@"
|
|
return $?
|
|
}
|
|
|
|
function count_in_db {
|
|
count=$(use_db "count_in_db" "$@")
|
|
return "${count}"
|
|
}
|
|
|
|
function get_from_db {
|
|
use_db "get_from_db" "$@"
|
|
return $?
|
|
}
|