t_master: validacion ARG -> $ANGULO

Solo verifica que no sea ""
This commit is contained in:
jp.av.dev 2022-02-14 15:44:56 -03:00
parent 4a8c7f852d
commit f9e1293a42
2 changed files with 17 additions and 6 deletions

View File

@ -78,6 +78,7 @@ while [[ $# -gt 0 ]]; do
-r|--rotar) -r|--rotar)
ROTAR=1 ROTAR=1
ANGULO="$2" # Validar?! ANGULO="$2" # Validar?!
[ ${ANGULO} -eq 0 ] && Err 1 "El angulo de giro debe ser: 90 - 180 - 270"
shift shift
shift shift
;; ;;
@ -91,7 +92,6 @@ done
[ -n "${INTERVALO}" ] || Err 1 "Debes Ingresar un intervalo" [ -n "${INTERVALO}" ] || Err 1 "Debes Ingresar un intervalo"
[ "${INTERVALO}" -lt 15 ] && Err 1 "Intervalo de capturas debe ser >= 15" [ "${INTERVALO}" -lt 15 ] && Err 1 "Intervalo de capturas debe ser >= 15"
[ ${CONTADOR} -eq 0 ] && [ ${T_FIN} -eq 0 ] && Err 1 "Debes ingresar un limite (tiempo o cantidad) (--help)" [ ${CONTADOR} -eq 0 ] && [ ${T_FIN} -eq 0 ] && Err 1 "Debes ingresar un limite (tiempo o cantidad) (--help)"
[ ${ANGULO} -eq 0 ] && Err 1 "El angulo de giro debe ser: 90 - 180 - 270"
NOMBRE_DIR="${NOMBRE_BASE}_$(date +'%d-%m-%Y_%H:%M')" NOMBRE_DIR="${NOMBRE_BASE}_$(date +'%d-%m-%Y_%H:%M')"
DIR_BASE="${DIR_BASE}${NOMBRE_DIR}/" DIR_BASE="${DIR_BASE}${NOMBRE_DIR}/"
@ -116,7 +116,7 @@ if [ "${CONTADOR}" -gt 0 ]; then
captura captura
((CONTADOR--)) ((CONTADOR--))
else else
sleep 0.25 sleep 0.20
fi fi
done done
else else

View File

@ -107,7 +107,9 @@ while [[ $# -gt 0 ]]; do
;; ;;
-r|--rotar) -r|--rotar)
ROTAR=1 ROTAR=1
ANGULO="$2" # Validar?! [ "" = "$2" ] && Err 1 "El angulo de giro debe ser: 90 - 180 - 270"
ANGULO=${2}
[ ${ANGULO} -le 0 ] && Err 1 "El angulo de giro debe ser: 90 - 180 - 270"
shift shift
shift shift
;; ;;
@ -122,15 +124,24 @@ done
[ ${COPIA} -gt 0 ] && Importar [ ${COPIA} -gt 0 ] && Importar
[ -n "${INTERVALO}" ] || Err 1 "Debes Ingresar un intervalo" [ -n "${INTERVALO}" ] || Err 1 "Debes Ingresar un intervalo"
[ "${INTERVALO}" -lt 15 ] && Err 1 "Intervalo de capturas debe ser >= 15" [ "${INTERVALO}" -lt 15 ] && Err 1 "Intervalo de capturas debe ser >= 15"
[ ${ANGULO} -eq 0 ] && Err 1 "El angulo de giro debe ser: 90 - 180 - 270"
[ ${CONTADOR} -eq 0 ] && [ ${T_FIN} -eq 0 ] && Err 1 "Debes ingresar un limite (tiempo o cantidad) (--help)" [ ${CONTADOR} -eq 0 ] && [ ${T_FIN} -eq 0 ] && Err 1 "Debes ingresar un limite (tiempo o cantidad) (--help)"
if [ "${CONTADOR}" -gt 0 ]; then if [ "${CONTADOR}" -gt 0 ]; then
# Limite por cantidad de capturas # Limite por cantidad de capturas
if [ "${ROTAR}" -gt 0 ]; then
# Rotar imagen
ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -c ${CONTADOR} -r ${ANGULO}" ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -c ${CONTADOR} -r ${ANGULO}"
else
ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -c ${CONTADOR}"
fi
else else
# Limite por tiempo # Limite por tiempo
if [ "${ROTAR}" -gt 0 ]; then
# Rotar imagen
ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -f ${T_FIN} -r ${ANGULO}" ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -f ${T_FIN} -r ${ANGULO}"
else
ssh -f "${MAQUINA}" "${DIR_PRGRM} -n ${NOMBRE_BASE} -i ${INTERVALO} -f ${T_FIN}"
fi
fi fi
######################################################################### #########################################################################