18 lines
362 B
Bash
Executable file
18 lines
362 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
umask 077
|
|
|
|
if [ -z "${username:-}" ] || [ -z "${password:-}" ]; then
|
|
exit 2
|
|
fi
|
|
|
|
if [ "$(echo "$username" | sed -r 's/^[a-z]+$/x/')" != "x" ]; then
|
|
exit 2
|
|
fi
|
|
|
|
curl -sf -X POST -H "Content-Type: application/json" -d @- \
|
|
https://id.foo.sh/authcheck <<EOF
|
|
{"username": "${username}", "password": "${password}", "group": "foosh"}
|
|
EOF
|