diff options
| author | 2023-09-17 20:30:08 +0600 | |
|---|---|---|
| committer | 2023-09-17 20:30:08 +0600 | |
| commit | d68f074f0ae1fd29a452164988dce957ac18982f (patch) | |
| tree | c8a72af589d54b5bad27c51941ef88ca3e8b218e /data/scripts/common | |
| parent | 7ec0af389517c34eb6c81955de1f89f74e357c2b (diff) | |
| download | shopno-os-log-sync-d68f074f0ae1fd29a452164988dce957ac18982f.tar.gz shopno-os-log-sync-d68f074f0ae1fd29a452164988dce957ac18982f.zip | |
scripts: Rename scripts
Signed-off-by: Mubashshir <ahm@jadupc.com>
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" } |
