diff options
Diffstat (limited to '')
-rw-r--r-- | data/scripts/common (renamed from data/scripts/common.sh) | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/data/scripts/common.sh b/data/scripts/common index 0fbaa45..d1c3047 100644 --- a/data/scripts/common.sh +++ b/data/scripts/common @@ -1,6 +1,6 @@ #!/bin/bash -SERVER_URL="https://frypan.jadupc.com" #"builder.jadupc.com" +SERVER_URL="https://frypan.jadupc.com" #"dev.jadupc.com" if [[ $DEBUG ]]; then SERVER_URL="http://log-server.local" @@ -22,14 +22,14 @@ function getaddr function communicate { - local endpoint type wlmac enmac year week day month + local endpoint type wlmac enmac year week day month hour endpoint="$1" type="$2" wlmac="$3" enmac="$4" year="$5" shift 5 - case "${type#*/}" in + case "${type##*/}" in weekly) week="$1" shift 1 @@ -41,10 +41,18 @@ function communicate shift 2 set -- -d "month=$month" -d "day=$day" "$@" ;; + hourly) + month="$1" + day="$2" + hour="$3" + shift 3 + set -- -d "month=$month" -d "day=$day" -d "hour=$hour" "$@" + ;; esac + [[ "${type%%/*}" != "user" ]] || set -- -d "user=$USER" "$@" curl --disable -Ls \ -d "type=${type%%/*}" -d "wlmac=$wlmac" \ - -d "enmac=$enmac" -d "year=$year" -d "user=$USER" "$@" \ + -d "enmac=$enmac" -d "year=$year" "$@" \ "$SERVER_URL$endpoint" } |