2
0
Fork 0
mirror of https://github.com/kdabir/has.git synced 2024-11-11 14:40:48 +01:00
has/bin/db/dq.sh
2014-03-05 03:46:26 +05:30

28 lines
433 B
Bash

OK=0
KO=0
_dq_report () {
if [ "$2" -eq 0 ]; then
echo "$1"
OK=$(($OK+1))
else
echo "$1"
KO=$(($KO+1))
fi
}
mongo --version > /dev/null 2>&1
_dq_report 'mongo client' $?
mongod --version > /dev/null 2>&1
_dq_report 'mongo server' $?
mysql --version > /dev/null 2>&1
_dq_report 'mysql client' $?
psql --version > /dev/null 2>&1
_dq_report 'postgres client' $?
echo Your dq is $OK / $(($OK+$KO))
exit $KO