2017-03-24 11:14:03 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set +e
|
|
|
|
|
2018-09-19 04:17:07 +02:00
|
|
|
STATUS_LOGIN=$(curl --insecure -w '%{http_code}' -d "principal=$1&password=$2" https://localhost/c/login)
|
|
|
|
if [ $STATUS_LOGIN -eq 200 ]; then
|
2017-03-24 11:14:03 +01:00
|
|
|
echo "Login Harbor success."
|
|
|
|
else
|
|
|
|
echo "Login Harbor fail."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2018-09-19 04:17:07 +02:00
|
|
|
STATUS_LOGOUT=$(curl --insecure -s -o /dev/null -w '%{http_code}' https://localhost/c/log_out)
|
2017-03-24 11:14:03 +01:00
|
|
|
if [ $STATUS_LOGOUT -eq 200 ]; then
|
|
|
|
echo "Logout Harbor success."
|
|
|
|
else
|
|
|
|
echo "Logout Harbor fail."
|
|
|
|
exit 1
|
|
|
|
fi
|