mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
Update main.sh
This commit is contained in:
parent
8dcbafcc73
commit
0fae1613e3
1 changed files with 6 additions and 2 deletions
|
@ -86,7 +86,9 @@ log_history() {
|
||||||
# Result checker
|
# Result checker
|
||||||
check_result() {
|
check_result() {
|
||||||
if [ $1 -ne 0 ]; then
|
if [ $1 -ne 0 ]; then
|
||||||
echo "Error: $2"
|
if [ -z "$SILENT_MODE" ]; then
|
||||||
|
echo "Error: $2"
|
||||||
|
fi
|
||||||
if [ ! -z "$3" ]; then
|
if [ ! -z "$3" ]; then
|
||||||
log_event "$3" "$ARGUMENTS"
|
log_event "$3" "$ARGUMENTS"
|
||||||
exit $3
|
exit $3
|
||||||
|
@ -100,7 +102,9 @@ check_result() {
|
||||||
# Argument list checker
|
# Argument list checker
|
||||||
check_args() {
|
check_args() {
|
||||||
if [ "$1" -gt "$2" ]; then
|
if [ "$1" -gt "$2" ]; then
|
||||||
echo "Usage: $(basename $0) $3"
|
if [ -z "$SILENT_MODE" ]; then
|
||||||
|
echo "Usage: $(basename $0) $3"
|
||||||
|
fi
|
||||||
check_result $E_ARGS "not enought arguments" >/dev/null
|
check_result $E_ARGS "not enought arguments" >/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue