This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from echo-webkom/develop
Registration count
- Loading branch information
Showing
6 changed files
with
174 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Default values | ||
host=http://localhost | ||
port=8080 | ||
user=bedkom | ||
|
||
while getopts zpe:s:x:uw flag; do | ||
case "${flag}" in | ||
z) host=${OPTARG} ;; | ||
p) port=${OPTARG} ;; | ||
s) slug=${OPTARG} ;; | ||
x) secret=${OPTARG} ;; | ||
u) user=${OPTARG} ;; | ||
w) waitlist=${OPTARG} ;; | ||
*) echo "Invalid flag." ;; | ||
esac | ||
done | ||
|
||
if [ -z ${secret+x} ]; then | ||
echo "No authorization header specified (use -x)." | ||
exit 1 | ||
fi | ||
|
||
if [ -z ${slug+x} ]; then | ||
echo "No slug specified (use -s)." | ||
exit 1 | ||
elif [ -z ${waitlist+x} ]; then | ||
curl --verbose \ | ||
-u "$user":"$secret" \ | ||
"$host:$port/registration?count=y&slug=$slug" | ||
else | ||
curl --verbose \ | ||
-u "$user":"$secret" \ | ||
"$host:$port/registration?count=y&slug=$slug&waitlist=y" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters