18 lines
512 B
Plaintext
18 lines
512 B
Plaintext
|
|
# 1. Set your secret
|
||
|
|
SECRET="j@mk@Z@3"
|
||
|
|
|
||
|
|
# 2. Create a username (Current time + 1 day expiration : "testuser")
|
||
|
|
# $(date +%s) gets current timestamp, 86400 is 24 hours in seconds
|
||
|
|
TIMESTAMP=$(($(date +%s) + 86400))
|
||
|
|
USERNAME="${TIMESTAMP}:testuser"
|
||
|
|
|
||
|
|
# 3. Generate the password
|
||
|
|
PASSWORD=$(echo -n $USERNAME | openssl dgst -sha1 -hmac $SECRET -binary | base64)
|
||
|
|
# 4. Print results
|
||
|
|
echo "Username: $USERNAME"
|
||
|
|
echo "Password: $PASSWORD"
|
||
|
|
|
||
|
|
turnutils_uclient -y -v -u "$USERNAME" -w "$PASSWORD" coturn.video.jamkazam.com
|
||
|
|
|
||
|
|
|