ul11u4 gate open checks for queued RTIs

main
Petr Nyc 7 months ago
parent 8ab6bd4bff
commit 89369e066d
  1. 12
      bin/lib/logging.sh
  2. 15
      bin/ul11u4_gate_open.sh

@ -5,6 +5,8 @@
trap 'exit 1' HUP INT QUIT TERM
trap 'on_error' EXIT
log::prefix() {
date=$(gdate '+%Y-%m-%d %H:%M:%S,%3N')
printf '%s %s\n' "${date}" "${*}"
@ -31,11 +33,13 @@ log::error() {
}
log::fatal() {
reason='Unknown or not specified'
if [ "$1" ]; then
reason=$1
fi
reason="${1-Unknown or not specified}"
log::error "Fatal error. Reason: ${reason}"
kill -s TERM $$
}
on_error() {
if [ $? -ne 0 ]; then
log::fatal "Unhandled script failure"
fi
}

@ -1,7 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091,SC2015
[[ "$0" == /* ]] && typeset -r PRG=$0 || typeset -r PRG=$PWD/$0
BINDIR=$(dirname "$PRG")
@ -9,14 +7,21 @@ typeset -r BINDIR
source "${BINDIR}/lib/logging.sh"
TARGET=$1
TARGET="${1-11.4.81.0.1.195.1}"
URL="http://grt.us.oracle.com/grt/webservice/grtList/?gate=20&show=All&gateName=S11.4-SRU&status=1&target=${TARGET}"
out=$(w3m "$URL" -M -cols 400 -graph -dump | awk '/^Details/ {found=1; next} found && NF')
if [ -z "$TARGET" ];
if [[ -z "$out" ]];
then
log::fatal "No target specified on command line"
log::info "There are no queued RTIs for \"${TARGET}\". Nothing to do..."
exit 0
fi
log::info "Opening the gate for ${TARGET}"
log::debug "Starting gate open for Ul11u4SRU"
log::debug "Target: \"${TARGET}\""

Loading…
Cancel
Save