This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-libzt/check.sh

17 lines
282 B
Bash
Raw Normal View History

2016-06-23 12:07:51 -07:00
#!/bin/bash
2016-11-03 17:18:03 -07:00
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
2016-06-23 12:07:51 -07:00
FILE="$1"
2016-06-23 12:17:37 -07:00
if ([ -f "$FILE" ] && [ -s "$FILE" ]) || ([ -d "$FILE" ] && [ "$(ls -A "$FILE")" ]);
2016-06-23 12:07:51 -07:00
then
2016-11-03 17:18:03 -07:00
echo "${green}[OK ]${reset} $FILE"
exit 0
2016-06-23 12:07:51 -07:00
else
2016-11-03 17:18:03 -07:00
echo "${red}[FAIL]${reset} $FILE" >&2
exit 1
2016-06-23 12:07:51 -07:00
fi