File: curl-test.sh

package info (click to toggle)
json2file-go 1.15
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: sh: 298; makefile: 10
file content (14 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# NOTE: The test assumes that we have a ':' entry on the J2F_DIRLIST variable
DATE="$(date)"
test_https() {
    sudo curl --header "Content-Type: application/json" \
              --request POST \
              --data "{\"date\":\"$DATE\",\"type\":\"socket\"}" \
              --insecure \
              https://localhost/
}
case "$1" in
https) test_https;;
*) echo "Usage: $0 {https}";;
esac